Dockerfile: Add golang-migrate
This commit is contained in:
parent
1816d0be4b
commit
b4f00d6f2d
|
@ -2,6 +2,7 @@ FROM golang:1.18-alpine3.15 as go-builder
|
|||
ENV GOPATH ""
|
||||
|
||||
RUN apk add git
|
||||
RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
|
||||
|
||||
WORKDIR /app
|
||||
ADD go.mod go.sum ./
|
||||
|
@ -11,6 +12,8 @@ RUN go build -o ./elon .
|
|||
|
||||
FROM alpine:3.14
|
||||
|
||||
COPY sql/migrations /app/migrations
|
||||
COPY --from=go-builder /app/elon /app/elon
|
||||
COPY --from=go-builder /root/go/bin/migrate /bin/migrate
|
||||
|
||||
ENTRYPOINT ["/app/elon"]
|
||||
|
|
Reference in New Issue