infra/docker/sudoscientist-go-backend/Dockerfile

15 lines
600 B
Docker

FROM golang:alpine
RUN apk add --no-cache git && \
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest && \
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 -o /go/bin/sudoscientist-go-backend main.go && \
mv /go/bin/* /usr/local/bin/ && \
rm -rf /go/src && \
apk del git
CMD ["/usr/local/bin/sudoscientist-go-backend"]