# External Services This directory contains Docker Compose configurations for external services that run on the production server. ## Services ### Traefik - **Location**: `traefik/` - **Purpose**: Reverse proxy and load balancer for all services - **Deploy**: `cd traefik && docker compose up -d` - **Access**: https://traefik.harkon.co.uk ### Authentik - **Location**: `authentik/` - **Purpose**: SSO and authentication provider - **Deploy**: `cd authentik && docker compose up -d` - **Access**: https://authentik.harkon.co.uk ### Gitea - **Location**: `gitea/` - **Purpose**: Git repository hosting and container registry - **Deploy**: `cd gitea && docker compose up -d` - **Access**: https://gitea.harkon.co.uk ### Nextcloud - **Location**: `nextcloud/` - **Purpose**: File storage and collaboration - **Deploy**: `cd nextcloud && docker compose up -d` - **Access**: https://nextcloud.harkon.co.uk ### Portainer - **Location**: `portainer/` - **Purpose**: Docker management UI - **Deploy**: `cd portainer && docker compose up -d` - **Access**: https://portainer.harkon.co.uk ## Deployment ### Production (Remote Server) ```bash # SSH to server ssh deploy@141.136.35.199 # Navigate to service directory cd /opt/ai-tax-agent/infra/compose/ # Deploy service docker compose up -d # Check logs docker compose logs -f # Check status docker compose ps ``` ### Local Development For local development, use the all-in-one compose file: ```bash cd infra/compose docker compose -f docker-compose.local.yml up -d ``` ## Configuration Each service has its own `.env` file for environment-specific configuration: - `traefik/.provider.env` - GoDaddy API credentials - `authentik/.env` - Authentik secrets - `gitea/.env` - Gitea database credentials ## Networks All services use shared Docker networks: - `frontend` - Public-facing services - `backend` - Internal services Create networks before deploying: ```bash docker network create frontend docker network create backend ``` ## Maintenance ### Update Service ```bash cd /opt/ai-tax-agent/infra/compose/ docker compose pull docker compose up -d ``` ### Restart Service ```bash cd /opt/ai-tax-agent/infra/compose/ docker compose restart ``` ### View Logs ```bash cd /opt/ai-tax-agent/infra/compose/ docker compose logs -f ``` ### Backup Data ```bash # Backup volumes docker run --rm -v _data:/data -v $(pwd):/backup alpine tar czf /backup/-backup.tar.gz /data ``` ## Integration with Application These external services are used by the application infrastructure: - **Traefik** - Routes traffic to application services - **Authentik** - Provides SSO for application UIs - **Gitea** - Hosts Docker images for application services The application infrastructure is deployed separately using: ```bash ./infra/scripts/deploy.sh production infrastructure ./infra/scripts/deploy.sh production services ```