2022-07-13 15:52:25 -07:00
|
|
|
FROM golang:1.18.4 as build
|
2022-04-02 12:05:32 -07:00
|
|
|
|
|
|
|
COPY . /app
|
|
|
|
WORKDIR /app
|
|
|
|
RUN go build .
|
2022-06-08 21:17:08 -07:00
|
|
|
RUN go install github.com/pressly/goose/v3/cmd/goose@latest
|
2022-04-02 12:05:32 -07:00
|
|
|
|
2022-07-13 15:52:25 -07:00
|
|
|
FROM alpine:latest as app
|
2022-04-02 12:05:32 -07:00
|
|
|
|
2022-07-13 15:52:25 -07:00
|
|
|
RUN apk --no-cache add bash libc6-compat
|
|
|
|
RUN mkdir /app && mkdir /app/migrations
|
2022-04-02 12:09:43 -07:00
|
|
|
COPY --from=build /app/collector /app
|
2022-06-08 21:17:08 -07:00
|
|
|
COPY --from=build /go/bin/goose /app
|
|
|
|
COPY ./database/migrations/ /app/migrations
|
|
|
|
|
2022-07-13 15:52:25 -07:00
|
|
|
CMD [ "/app/collector" ]
|