-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (104 loc) · 2.48 KB
/
Copy pathdocker-compose.yml
File metadata and controls
110 lines (104 loc) · 2.48 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
services:
postgres:
image: postgres:16-alpine
container_name: gatepass-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
TZ: UTC
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- gatepass-net
redis:
image: redis:7-alpine
container_name: gatepass-redis
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- gatepass-net
gatepass-api:
build:
context: ./gatepass-api
container_name: gatepass-api
restart: unless-stopped
ports:
- "4001:4001"
environment:
NODE_ENV: production
TZ: UTC
PORT: ${API_PORT}
DATABASE_URL: ${DATABASE_URL}
REDIS_URL: ${REDIS_URL}
DELIVERY_EVENTS_CHANNEL: ${DELIVERY_EVENTS_CHANNEL}
CORS_ORIGIN: ${CORS_ORIGIN}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:4001/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 10s
timeout: 5s
retries: 5
networks:
- gatepass-net
gatepass-security:
build:
context: ./gatepass-security
container_name: gatepass-security
restart: unless-stopped
ports:
- "5173:5173"
environment:
VITE_API_BASE_URL: ${VITE_API_BASE_URL}
VITE_SOCKET_URL: ${VITE_SOCKET_URL}
depends_on:
gatepass-api:
condition: service_healthy
networks:
- gatepass-net
gatepass-resident:
build:
context: ./gatepass-resident
container_name: gatepass-resident
restart: unless-stopped
ports:
- "5174:5174"
environment:
VITE_API_BASE_URL: ${VITE_API_BASE_URL}
VITE_SOCKET_URL: ${VITE_SOCKET_URL}
depends_on:
gatepass-api:
condition: service_healthy
networks:
- gatepass-net
volumes:
postgres_data:
networks:
gatepass-net:
driver: bridge