Files
licenseServer/Dockerfile
T
2026-05-05 08:44:55 +00:00

27 lines
485 B
Docker

FROM golang:1.21-alpine AS builder
RUN apk add --no-cache gcc musl-dev sqlite-dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -o licensevault ./cmd/server
# ---- Runtime ----
FROM alpine:3.19
RUN apk add --no-cache sqlite-libs ca-certificates
WORKDIR /app
COPY --from=builder /app/licensevault .
COPY templates/ templates/
ENV PORT=8080
ENV DB_PATH=/data/licenses.db
VOLUME ["/data"]
EXPOSE 8080
CMD ["./licensevault"]