Skip to content

Commit

Permalink
Add migrate to docker (#26)
Browse files Browse the repository at this point in the history
With these changes, those who might want to execute migrations on other containers will be able to since all necessary files are available in the docker image

Co-authored-by: João Bologna <joao.bologna@wildlifestudios.com>
  • Loading branch information
joaobologna and João Bologna committed Dec 1, 2020
1 parent c54320b commit a9cff14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Expand Up @@ -11,16 +11,20 @@ RUN go mod download

COPY . .
RUN make build
RUN CGO_ENABLED=0 GOOS=linux go build -pkgdir=$GOPATH/pkg/mod/ -tags 'postgres' -o bin/migrate \
github.com/golang-migrate/migrate/v4/cmd/migrate

FROM alpine:3.10

RUN apk add --no-cache ca-certificates

WORKDIR /app

COPY --from=build-env /Will.IAM/bin/Will.IAM /app
COPY --from=build-env /Will.IAM/config /app/config
COPY --from=build-env /Will.IAM/assets /app/assets
COPY --from=build-env /Will.IAM/migrations /app/postgres/migrations
COPY --from=build-env /Will.IAM/bin/migrate /app/postgres

EXPOSE 4040

Expand Down

0 comments on commit a9cff14

Please sign in to comment.