Files
kontor/kontor-fiber/Containerfile
T
tpeetz ad09386a7a
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
update kontor-fiber to use Go Fiber v3
2026-09-20 02:08:56 +02:00

26 lines
831 B
Docker

# ---------- Stage 1: Build ----------
FROM docker.io/library/golang:1.26-alpine AS builder
# Set the working directory
WORKDIR /app
# Ensure a portable, static-ish binary
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
# Copy and download dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the source code
COPY . .
# Build the Go application (strip debug info for smaller size)
RUN go build -trimpath -ldflags="-s -w" -o kontor cmd/kontor/main.go
# ---------- Stage 2: Final ----------
FROM alpine:latest
# Set the working directory
WORKDIR /app
# Install runtime dependencies you actually need
RUN apk add --no-cache ca-certificates tzdata curl
# Copy the binary and set ownership
COPY --from=builder /app/kontor /app/kontor
COPY --from=builder /app/views /app/views
# Set the entrypoint command
ENTRYPOINT ["/app/kontor"]