Some checks failed
CI/CD Pipeline / Code Quality & Linting (push) Has been cancelled
CI/CD Pipeline / Policy Validation (push) Has been cancelled
CI/CD Pipeline / Test Suite (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-coverage) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-extract) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-firm-connectors) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-forms) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-hmrc) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-ingestion) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-kg) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-normalize-map) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-ocr) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-rag-indexer) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-rag-retriever) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-reason) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-rpa) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (ui-review) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-coverage) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-extract) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-kg) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-rag-retriever) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (ui-review) (push) Has been cancelled
CI/CD Pipeline / Generate SBOM (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Notifications (push) Has been cancelled
134 lines
2.9 KiB
Markdown
134 lines
2.9 KiB
Markdown
# 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/<service>
|
|
|
|
# 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/<service>
|
|
docker compose pull
|
|
docker compose up -d
|
|
```
|
|
|
|
### Restart Service
|
|
|
|
```bash
|
|
cd /opt/ai-tax-agent/infra/compose/<service>
|
|
docker compose restart
|
|
```
|
|
|
|
### View Logs
|
|
|
|
```bash
|
|
cd /opt/ai-tax-agent/infra/compose/<service>
|
|
docker compose logs -f
|
|
```
|
|
|
|
### Backup Data
|
|
|
|
```bash
|
|
# Backup volumes
|
|
docker run --rm -v <service>_data:/data -v $(pwd):/backup alpine tar czf /backup/<service>-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
|
|
```
|