infra/docker/sudoscientist-go-backend/Dockerfile

20 lines
766 B
Docker
Raw Normal View History

FROM golang:1.17-alpine3.14
2021-01-17 01:45:50 +00:00
RUN apk add --no-cache ca-certificates git && \
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest && \
2021-01-17 01:45:50 +00:00
mkdir -p ${GOPATH}/src/git.minhas.io/asara && \
cd ${GOPATH}/src/git.minhas.io/asara && \
git clone https://git.minhas.io/asara/sudoscientist-go-backend && \
cd ${GOPATH}/src/git.minhas.io/asara/sudoscientist-go-backend && \
go mod init && go get && go build main.go && \
2021-01-17 01:45:50 +00:00
mv /go/bin/* /usr/local/bin/ && \
rm -rf /go/src && \
apk del git
# Copy masked.name root cert
COPY files/MaskedName_Root_CA.crt /usr/local/share/ca-certificates/MaskedName_Root_CA.crt
# update ca certs
RUN update-ca-certificates 2>/dev/null
CMD ["/usr/local/bin/sudoscientist-go-backend"]