Files
2026-04-29 14:27:16 +03:00

25 lines
445 B
Docker

FROM golang:1.26-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /server ./cmd/main.go && \
go install github.com/pressly/goose/v3/cmd/goose@latest
FROM alpine:3.19
RUN apk add --no-cache ca-certificates
WORKDIR /app
COPY --from=builder /server /server
COPY --from=builder /go/bin/goose /usr/local/bin/goose
COPY migrations /app/migrations
EXPOSE 8080
CMD ["/server"]