generated from damir/go_app_template
Update Dockerfile
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -21,10 +21,22 @@ RUN go mod tidy
|
|||||||
# Собираем бинарник
|
# Собираем бинарник
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /app-binary main.go
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /app-binary main.go
|
||||||
|
|
||||||
# ЭТАП 2: Финальный образ (без изменений)
|
# ЭТАП 2: Финальный образ
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
RUN apk --no-cache add ca-certificates tzdata
|
RUN apk --no-cache add ca-certificates tzdata
|
||||||
|
|
||||||
|
# Указываем рабочую директорию
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
|
|
||||||
|
# Копируем бинарник
|
||||||
COPY --from=builder /app-binary .
|
COPY --from=builder /app-binary .
|
||||||
|
|
||||||
|
# КОПИРУЕМ HTML ФАЙЛ (добавь эту строку)
|
||||||
|
COPY index.html .
|
||||||
|
|
||||||
|
# Открываем порт
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Запускаем
|
||||||
CMD ["./app-binary"]
|
CMD ["./app-binary"]
|
||||||
Reference in New Issue
Block a user