Files
dance-lessons-coach/docker/Dockerfile.prod.template
Gabriel Radureau 28002070bc
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 10s
CI/CD Pipeline / CI Pipeline (push) Successful in 4m23s
CI/CD Pipeline / Docker Push (push) Failing after 39s
🐛 fix: Dockerfile.prod.template to build binary during Docker build
2026-04-09 09:01:32 +02:00

40 lines
1000 B
Docker

# dance-lessons-coach Production Docker Image
# Minimal image using pre-built binary from CI cache
# Template: Replace {{DEPS_HASH}} with actual dependency hash
# Use the build cache image as base for building
FROM gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:{{DEPS_HASH}} AS builder
# Set working directory and build the binary
WORKDIR /workspace
RUN go build -o dance-lessons-coach ./cmd/server
# Final minimal image
FROM alpine:3.18
WORKDIR /app
# Install minimal dependencies
RUN apk add --no-cache ca-certificates tzdata
# Copy binary from builder
COPY --from=builder /workspace/dance-lessons-coach /app/dance-lessons-coach
# Copy configuration
COPY config.yaml /app/config.yaml
# Set permissions
RUN chmod +x /app/dance-lessons-coach
# Set timezone
ENV TZ=UTC
# Expose port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget -q --spider http://localhost:8080/api/health || exit 1
# Entry point
ENTRYPOINT ["/app/dance-lessons-coach"]