Files
certctl/deploy/docker-compose.dev.yml
T
shankar0123 c6efa4ab39 docs: add Docker Compose environments guide and fix compose files
- New deploy/ENVIRONMENTS.md: comprehensive walkthrough of all 4 compose
  files with service-by-service explanations, beginner-friendly Docker
  concepts, and expert-level networking/config details
- Fix docker-compose.dev.yml: agent LOG_LEVEL → CERTCTL_LOG_LEVEL (was
  silently ignored without the CERTCTL_ prefix)
- Add CERTCTL_CONFIG_ENCRYPTION_KEY to base and test compose (enables
  M34/M35 dynamic issuer/target config encryption)
- Add CERTCTL_DISCOVERY_DIRS to base compose agent (enables filesystem
  certificate discovery in default deployment)
- Cross-link ENVIRONMENTS.md from README doc table and quickstart.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 21:57:17 -04:00

59 lines
1.8 KiB
YAML

version: '3.8'
# Development overrides for docker-compose.yml
# Usage: docker-compose -f deploy/docker-compose.yml -f deploy/docker-compose.dev.yml up
services:
# Override server configuration for development
certctl-server:
build:
context: ..
dockerfile: Dockerfile
environment:
# Verbose logging for development
CERTCTL_LOG_LEVEL: debug
CERTCTL_SERVER_HOST: 0.0.0.0
CERTCTL_SERVER_PORT: "8443"
volumes:
# Mount local source for hot reload (requires air or similar)
# Uncomment if using air or similar for hot reload:
# - ../cmd:/app/cmd
# - ../internal:/app/internal
# - ../api:/app/api
ports:
- "8443:8443"
- "40000:40000" # Delve debugger port (if debugging)
# Override agent configuration for development
certctl-agent:
build:
context: ..
dockerfile: Dockerfile.agent
environment:
CERTCTL_LOG_LEVEL: debug
# PgAdmin for database exploration
pgadmin:
image: dpage/pgadmin4:latest
container_name: certctl-pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:-admin@example.com}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- certctl-network
depends_on:
- postgres
restart: unless-stopped
# Notes for development:
# 1. Enable hot reload by installing air: go install github.com/cosmtrek/air@latest
# Then in cmd/server and cmd/agent, create .air.toml for watch configuration
# 2. Debug the server by attaching Delve to port 40000
# 3. Access PgAdmin at http://localhost:5050 to browse the database
# 4. View server logs: docker-compose logs -f certctl-server
# 5. View agent logs: docker-compose logs -f certctl-agent