FROM golang:1.22-alpine AS build WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY src ./src COPY static ./static RUN CGO_ENABLED=0 GOOS=linux go build -o /out/scrum-solitare ./src FROM alpine:3.21 WORKDIR /app RUN addgroup -S app && adduser -S app -G app COPY --from=build /out/scrum-solitare /app/scrum-solitare COPY --from=build /app/src/templates /app/src/templates COPY --from=build /app/static /app/static RUN mkdir -p /app/data && chown -R app:app /app EXPOSE 8002 ENV HOST=0.0.0.0 ENV PORT=8002 USER app ENTRYPOINT ["/app/scrum-solitare"]