API Server Setup
The API server runs at api.pgas.ph and is served via Caddy as a reverse proxy in front of the application container.
Directory Structure
Section titled “Directory Structure”api-server/├── docker-compose.yml├── Caddyfile├── .env└── app/ # API application source or mounted volumedocker-compose.yml
Section titled “docker-compose.yml”services: api: image: # TODO: specify API image container_name: pgas-api restart: unless-stopped env_file: - .env expose: - "3000"
caddy: image: caddy:2-alpine container_name: pgas-api-caddy restart: unless-stopped ports: - "80:80" - "443:443" volumes: - ./Caddyfile:/etc/caddy/Caddyfile:ro - caddy_data:/data - caddy_config:/config
volumes: caddy_data: caddy_config:Caddyfile
Section titled “Caddyfile”api.pgas.ph { reverse_proxy api:3000}Caddy handles TLS automatically via Let’s Encrypt. No additional certificate configuration is needed as long as port 443 is reachable from the internet.
Environment Variables
Section titled “Environment Variables”Create a .env file in the project directory:
# TODO: add application-specific environment variablesDeployment
Section titled “Deployment”docker compose pulldocker compose up -d- TODO: document the API application itself (language, framework, etc.)
- TODO: document any database or external service dependencies
- TODO: document health check endpoint