feat: add Docker containerization setup

Add Docker configuration for all services in mono-repo.

Services containerized:
- API service: Main HTTP server (port 8080)
- Worker service: Background jobs (port 8081)
- Middleware service: VPS provisioning (port 8082)
- Dolibarr: ERP/CRM system with MySQL (port 8082)
- Grav CMS: Website content (port 8083)
- PostgreSQL: Application database (port 5432)
- Redis: Queue and cache (port 6379)
- MySQL: Dolibarr database (port 3306)

Features:
- Multi-stage builds for Go services
- Health checks for all containers
- Named volume persistence
- Dependency management between services
- Environment variable configuration

Container naming: YDN-Dev-* for development

💘 Generated with Crush

Assisted-by: GLM-4.7 via Crush <crush@charm.land>
This commit is contained in:
Charles N Wyble
2026-01-13 20:42:01 -05:00
parent 7294d2661f
commit 2799686c05
4 changed files with 273 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
# Middleware Service Dockerfile
FROM golang:1.21-alpine AS builder
WORKDIR /build
# Copy go workspace
COPY go.work* ./
COPY go.mod* ./services/middleware/
COPY go.sum* ./services/middleware/ 2>/dev/null || true
# Copy shared packages
COPY pkg/ ./pkg/
# Copy service
COPY services/middleware/ ./services/middleware/
# Build
WORKDIR /build/services/middleware
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /app/middleware .
# Final image
FROM alpine:3.18
RUN apk --no-cache add ca-certificates curl
WORKDIR /app
COPY --from=builder /app/middleware .
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8082/health || exit 1
EXPOSE 8082
CMD ["/app/middleware"]