27 lines
787 B
Docker
27 lines
787 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# --- Build stage ---
|
|
FROM golang:1.24 as builder
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o iralex-einvoice main.go
|
|
|
|
# --- Run stage ---
|
|
FROM gcr.io/distroless/base-debian12:debug
|
|
WORKDIR /app
|
|
COPY --from=builder /app/iralex-einvoice ./iralex-einvoice
|
|
COPY --from=builder /app/.env.example ./.env.example
|
|
# If you want to provide a default .env, uncomment the next line:
|
|
# COPY --from=builder /app/.env ./.env
|
|
# Copy any static files or certs if needed (uncomment and adjust as needed)
|
|
# COPY --from=builder /app/static ./static
|
|
# COPY --from=builder /app/certs ./certs
|
|
|
|
# Expose the default port (can be overridden by env or flag)
|
|
EXPOSE 1404
|
|
|
|
# Entrypoint
|
|
ENTRYPOINT ["/app/iralex-einvoice"]
|