-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
92 lines (92 loc) · 2.08 KB
/
docker-compose.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
networks:
app-network:
driver: bridge
services:
surrealdb:
image: surrealdb/surrealdb:latest
container_name: surrealdb
command: start --user ${SURREALDB_USERNAME} --pass ${SURREALDB_PASSWORD} rocksdb:/data/database.db
environment:
- SURREAL_LOG=info
volumes:
- ./infrastructure/surrealdb/data:/data
ports:
- "127.0.0.1:8000:8000"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
networks:
- app-network
redis:
image: redis:latest
container_name: redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- ./infrastructure/redis/data:/data
command: ["redis-server", "--requirepass", "$REDIS_PASSWORD"]
networks:
- app-network
deploy:
resources:
limits:
cpus: "0.5"
memory: "512M"
reservations:
cpus: "0.25"
memory: "128M"
web-apps:
build:
context: .
dockerfile: web-apps/Dockerfile
container_name: web-apps
ports:
- "${WEB_APPS_PORT}:3000"
env_file:
- .env
environment:
- NODE_ENV=production
- BACKEND_SERVICE_HOST=http://backend-service:3001
- WEB_APPS_SOCKET_HOST=ws://backend-service:3001
restart: always
networks:
- app-network
deploy:
resources:
limits:
cpus: 2
memory: 512M
backend-service:
build:
context: ./backend-service
dockerfile: Dockerfile
container_name: backend-service
ports:
- "${BACKEND_SERVICE_PORT}:3001"
env_file:
- .env
environment:
- NODE_ENV=production
- SURREALDB_URL=http://surrealdb:8000
- REDIS_HOST=redis
restart: always
networks:
- app-network
deploy:
resources:
limits:
cpus: 2
memory: 512M