-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.green.yml
More file actions
73 lines (69 loc) · 2.31 KB
/
docker-compose.green.yml
File metadata and controls
73 lines (69 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
services:
backend:
build:
context: ./backend
container_name: crypto-ai-backend-green
env_file:
- .env
ports:
- ${API_PORT_GREEN:-3103}:${API_PORT:-3102}
# Note: Depends on shared infrastructure (postgres, redis) managed separately
# Infrastructure must be running before starting blue/green deployments
volumes:
- /srv/storagebox/statex/docker-volumes/crypto-ai-agent/logs:/app/logs
environment:
- DATABASE_URL=postgresql+psycopg://${POSTGRES_USER:-crypto}:${POSTGRES_PASSWORD:-crypto_pass}@db-server-postgres:${DB_SERVER_PORT:-5432}/${POSTGRES_DB:-crypto_ai_agent}
- API_PORT=${API_PORT:-3102}
- REDIS_URL=${REDIS_URL:-redis://db-server-redis:${REDIS_SERVER_PORT:-6379}/0}
- LOGGING_SERVICE_URL=${LOGGING_SERVICE_URL:-http://logging-microservice:${LOGGING_SERVICE_PORT:-3367}}
- AUTH_SERVICE_URL=${AUTH_SERVICE_URL:-http://auth-microservice:${AUTH_SERVICE_PORT:-3370}}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${API_PORT:-3102}/api/health"]
interval: 10s
timeout: 5s
retries: 2
deploy:
resources:
limits:
memory: 300M
cpus: '0.5'
reservations:
memory: 100M
networks:
- nginx-network
frontend:
build:
context: ./frontend
args:
DEBUG: ${DEBUG:-false}
container_name: crypto-ai-frontend-green
env_file:
- .env
ports:
- ${FRONTEND_PORT_GREEN:-3101}:${FRONTEND_PORT:-3100}
depends_on:
- backend
environment:
- PORT=${FRONTEND_PORT:-3100}
- NEXT_PUBLIC_DEBUG=${DEBUG:-false}
healthcheck:
test: ["CMD", "curl", "-f", "-L", "http://localhost:${FRONTEND_PORT:-3100}"]
interval: 10s
timeout: 5s
retries: 2
deploy:
resources:
limits:
memory: 300M
cpus: '0.5'
reservations:
memory: 100M
networks:
- nginx-network
# Note: postgres and redis are now managed by docker-compose.infrastructure.yml
# They run as singleton services, shared by both blue and green deployments.
# This prevents data corruption and ensures zero data loss.
# To start infrastructure: docker compose -f docker-compose.infrastructure.yml -p crypto_ai_agent_infrastructure up -d
networks:
nginx-network:
external: true