notatio/Dockerfile

29 lines
718 B
Docker

# Stage 1: Build the Go application
FROM docker.io/golang:1.20-alpine as builder
RUN apk --no-cache add ca-certificates git
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY editor_templates/ editor_templates/
COPY templates/ templates/
COPY static/ static/
COPY wait-for-postgres.sh ./
COPY . ./
RUN go build -o /notatio
# Stage 2: Create the final image
FROM alpine
WORKDIR /
COPY --from=builder /notatio .
COPY --from=builder /build/templates/ templates/
COPY --from=builder /build/editor_templates/ editor_templates/
COPY --from=builder /build/static/ static/
COPY --from=builder /build/wait-for-postgres.sh ./wait-for-postgres.sh
EXPOSE 9991
CMD ["./notatio"]
LABEL name=notatio version=latest