generated from damir/go_app_template
Update Dockerfile
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -21,17 +21,13 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /app-binary main.go
|
||||
|
||||
# ЭТАП 2: Финальный образ
|
||||
FROM alpine:latest
|
||||
|
||||
# Добавляем сертификаты (нужны для HTTPS запросов) и временную зону
|
||||
RUN apk --no-cache add ca-certificates tzdata
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
# Копируем только собранный бинарник из первого этапа
|
||||
# Копируем бинарник
|
||||
COPY --from=builder /app-binary .
|
||||
# ВАЖНО: копируем шаблоны
|
||||
COPY --from=builder /build/templates ./templates
|
||||
|
||||
# Открываем порт
|
||||
EXPOSE 8080
|
||||
|
||||
# Запускаем приложение
|
||||
CMD ["./app-binary"]
|
||||
Reference in New Issue
Block a user