FROM golang:1.17-alpine

WORKDIR /server

COPY infrastructure/go.mod infrastructure/go.sum ./
RUN apk add --no-cache curl tzdata build-base
RUN go install github.com/rubenv/sql-migrate/...@latest
RUN go mod download
COPY infrastructure/. ./

ENTRYPOINT ["make", "running-db-container", "env=production", "ops=up", "limit=1000"]