-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (72 loc) · 1.61 KB
/
docker-compose.yml
File metadata and controls
77 lines (72 loc) · 1.61 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
73
74
75
76
77
services:
db:
image: postgres:15
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
POSTGRES_DB: business
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "admin", "-d", "business"]
interval: 2s
timeout: 3s
retries: 20
start_period: 10s
networks:
- bm-network
redis:
image: redis:7
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 3s
retries: 10
start_period: 5s
networks:
- bm-network
backend:
build:
context: ./backend
dockerfile: Dockerfile
env_file: ./backend/.env
environment:
- DATABASE_URL=postgresql://admin:admin@db:5432/business
- REDIS_URL=redis://redis:6379
- NODE_ENV=production
volumes:
- ./backend/certs:/certs:ro
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "3001:3000"
restart: unless-stopped
networks:
- bm-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
env_file: ./frontend/.env
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_URL=http://localhost:3001
ports:
- "3000:3000"
depends_on:
backend:
condition: service_started
restart: unless-stopped
networks:
- bm-network
volumes:
db_data:
redis_data:
networks:
bm-network:
driver: bridge