FIX: Dockerfile added copy for assets; shutdown

This commit is contained in:
Danil Solovyov 2023-07-18 02:16:55 +05:00
parent 1416f8f907
commit 900bed979f
2 changed files with 21 additions and 20 deletions

@ -1,19 +1,20 @@
FROM golang:alpine as build FROM golang:alpine as build
WORKDIR /app WORKDIR /app
ARG GITLAB_TOKEN ARG GITLAB_TOKEN
RUN apk add git RUN apk add git
ENV GOPRIVATE=penahub.gitlab.yandexcloud.net/backend/penahub_common ENV GOPRIVATE=penahub.gitlab.yandexcloud.net/backend/penahub_common
RUN git config --global url."https://forgomod:${GITLAB_TOKEN}@penahub.gitlab.yandexcloud.net/".insteadOf "https://penahub.gitlab.yandexcloud.net/" RUN git config --global url."https://forgomod:${GITLAB_TOKEN}@penahub.gitlab.yandexcloud.net/".insteadOf "https://penahub.gitlab.yandexcloud.net/"
COPY . . COPY . .
RUN go mod download RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app ./cmd/verification/main.go RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app ./cmd/verification/main.go
FROM alpine FROM alpine
EXPOSE 7035 EXPOSE 7035
COPY --from=build app/app . COPY --from=build app/app .
COPY --from=build app/staging.env . COPY --from=build app/staging.env .
ENV DOMAIN=tempgen.pena.digital COPY --from=build app/assets ./assets
ENV YADISK_CLIENT_ID=1ed4b85c1a5c4e6abf783d3ea28fd947 ENV DOMAIN=tempgen.pena.digital
ENV YADISK_CLIENT_SECRET=e1d4f385c1274dccb7d29646b802d607 ENV YADISK_CLIENT_ID=1ed4b85c1a5c4e6abf783d3ea28fd947
RUN apk add --no-cache ca-certificates ENV YADISK_CLIENT_SECRET=e1d4f385c1274dccb7d29646b802d607
CMD ["/app"] RUN apk add --no-cache ca-certificates
CMD ["/app"]

@ -26,7 +26,7 @@ func gracefulShutdown(ctx context.Context, logger *zap.Logger, httpSrv *server.H
} }
if err := mongoClient.Disconnect(ctx); err != nil { if err := mongoClient.Disconnect(ctx); err != nil {
logger.Error("BoltDB", zap.Error(err)) logger.Error("MongoDB", zap.Error(err))
} }
} }