switch to mongodb uri instead of host/username/password

This commit is contained in:
2023-04-03 20:31:13 +02:00
parent 3d61f9b542
commit 1ba7fef3ef
3 changed files with 38 additions and 6 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM golang:alpine as builder
ARG ACCESS_TOKEN_USR="nothing"
ARG ACCESS_TOKEN_PWD="nothing"
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /
# Create a netrc file using the credentials specified using --build-arg
RUN printf "machine git.coopgo.io\n\
login ${ACCESS_TOKEN_USR}\n\
password ${ACCESS_TOKEN_PWD}\n"\
>> ~/.netrc
RUN chmod 600 ~/.netrc
COPY . .
RUN go mod download && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /server /
EXPOSE 8080
ENTRYPOINT ["/server"]