Added Docker build infrastructure: - Multi-stage build (builder, cache, production) - Dependency hashing for cache invalidation - GNU tar support for cache compatibility - Production and development Dockerfiles - Docker Compose for local development Build Optimization: - Dependency-based cache keys - Layer caching strategy - Cross-platform compatibility - Gitea Actions cache integration Files Added: - docker/Dockerfile.build - Build environment - docker/Dockerfile.prod - Production image - docker/Dockerfile.prod.template - Template-based generation - docker-compose.yml - Development setup - scripts/calculate-deps-hash.sh - Cache key calculation - scripts/test-docker-cache.sh - Cache testing Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
36 lines
873 B
Docker
36 lines
873 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
|
|
FROM gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:{{DEPS_HASH}} AS builder
|
|
|
|
# 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"] |