This repository has been archived on 2022-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
2022-05-19 19:51:12 +00:00
|
|
|
FROM golang:1.18-alpine3.15 as go-builder
|
|
|
|
ENV GOPATH ""
|
|
|
|
|
|
|
|
RUN apk add git
|
2022-05-22 17:59:20 +00:00
|
|
|
RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
|
2022-05-19 19:51:12 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
ADD go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
ADD ./ .
|
|
|
|
RUN go build -o ./elon .
|
|
|
|
|
|
|
|
FROM alpine:3.14
|
|
|
|
|
2022-05-22 17:59:20 +00:00
|
|
|
COPY sql/migrations /app/migrations
|
2022-05-19 19:51:12 +00:00
|
|
|
COPY --from=go-builder /app/elon /app/elon
|
2022-05-22 17:59:20 +00:00
|
|
|
COPY --from=go-builder /root/go/bin/migrate /bin/migrate
|
2022-05-19 19:51:12 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/app/elon"]
|