-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (66 loc) · 1.84 KB
/
docker-compose.yml
File metadata and controls
71 lines (66 loc) · 1.84 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
version: '3.8'
services:
redis:
image: redis:7-alpine
ports:
- "${REDIS_PORT:-6379}:6379"
command: redis-server --requirepass ${REDIS_PASSWORD:-redispass}
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-redispass}", "ping"]
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: quantum_project
POSTGRES_USER: quantum
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
ports:
- "${PG_PORT:-5432}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U quantum -d quantum_project"]
interval: 10s
timeout: 5s
retries: 5
backend:
build: ./backend
ports:
- "${BACKEND_PORT:-3001}:${BACKEND_PORT:-3001}"
env_file: ./backend/.env
environment:
DATABASE_URL: postgresql://quantum:${DB_PASSWORD:-password}@postgres:5432/quantum_project
REDIS_URL: redis://:${REDIS_PASSWORD:-redispass}@redis:6379
PORT: ${BACKEND_PORT:-3001}
NODE_ENV: development
APP_URL: http://localhost:${FRONTEND_PORT:-3000}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:${BACKEND_PORT:-3001}/health || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
frontend:
build: ./frontend
ports:
- "${FRONTEND_PORT:-3000}:${FRONTEND_PORT:-3000}"
env_file: ./frontend/.env
environment:
PORT: ${FRONTEND_PORT:-3000}
NEXT_PUBLIC_API_URL: /api
BACKEND_INTERNAL_URL: http://backend:${BACKEND_PORT:-3001}
depends_on:
backend:
condition: service_healthy
volumes:
pgdata:
redisdata: