Only two environments exist:
| Environment | URL | Purpose |
|---|---|---|
| Local | http://localhost:3000 |
Development on your machine |
| Production | https://legal.org.ua/ |
Live system |
There is no staging environment.
Production deploys via CI/CD only (never manual SSH):
- Create a feature branch from
main - Push changes and create a Pull Request
- Merge PR to
main(requires approval) - CI/CD pipeline (self-hosted runner) automatically:
- Detects changed services
- Builds Docker images
- Deploys via blue-green pattern (inactive color first)
- After approval, switches production traffic to new color
See .github/workflows/deploy-prod.yml for the full pipeline.
Production uses blue-green deployment pattern:
- Two sets of containers (blue and green)
.active-colorsfile tracks which color is currently serving traffic- New deploys go to the inactive color, then traffic is switched
- Nginx must be
--force-recreatedafter any upstream/backend change
cd deployment
# Copy environment template
cp .env.local.example .env.local
# Edit .env.local with your API keys
# Start all services
docker compose -f docker-compose.local.yml --env-file .env.local up -d
# Or use the management script
./manage-gateway.sh start localStandard local ports: PostgreSQL (5432), Redis (6379), Qdrant (6333-6334), Backend (3000), Frontend (5173).
See LOCAL_DEVELOPMENT.md for details.
| File | Purpose |
|---|---|
docker-compose.local.yml |
Local development |
docker-compose.prod.yml |
Production environment |
docker-compose.gateway.yml |
Nginx gateway |
- Never push directly to
main-- all changes go through PRs - Never manually recreate production containers -- use the deploy pipeline
- After code changes, always rebuild Docker images before testing
- SSH to prod as
ubuntu(alias:ssh prod)