20 lines
664 B
Docker
20 lines
664 B
Docker
|
FROM golang:alpine as build
|
||
|
WORKDIR /app
|
||
|
RUN apk add git
|
||
|
COPY . .
|
||
|
ARG GITLAB_TOKEN
|
||
|
ENV GOPRIVATE=penahub.gitlab.yandexcloud.net/backend/penahub_common
|
||
|
RUN git config --global url."https://buildToken:glpat-axA8ttckx3aPf_xd2Dym@penahub.gitlab.yandexcloud.net/".insteadOf "https://penahub.gitlab.yandexcloud.net/"
|
||
|
RUN go mod download
|
||
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o core
|
||
|
|
||
|
FROM alpine as prod
|
||
|
COPY --from=build /app/core .
|
||
|
COPY --from=build /app/dal/schema /dal/schema
|
||
|
EXPOSE 1488
|
||
|
ENV IS_PROD_LOG=false
|
||
|
ENV IS_PROD=false
|
||
|
ENV PORT=1488
|
||
|
ENV PG_CRED="host=postgres port=5432 user=squiz password=Redalert2 dbname=squiz sslmode=disable"
|
||
|
CMD ["/core"]
|