Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
88 lines (84 loc) · 2.32 KB
/
Copy pathdocker-compose.yml
File metadata and controls
88 lines (84 loc) · 2.32 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
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
env_file:
- ./frontend/.env.local
environment:
OPENAPI_URL: http://backend:8000/openapi.json
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./frontend:/app
- packages:/app/node_modules
ports:
- "5173:5173"
depends_on:
backend:
condition: service_healthy
restart: true
command: >
sh -ec '
lock_hash=$$(sha256sum package-lock.json | cut -d " " -f 1);
if [ ! -f node_modules/.webmun-lock-hash ] ||
[ "$$(cat node_modules/.webmun-lock-hash)" != "$$lock_hash" ]; then
npm ci;
printf "%s" "$$lock_hash" > node_modules/.webmun-lock-hash;
fi;
npm run generate:schema;
exec npm run dev -- --host 0.0.0.0 --port 5173
'
develop:
watch:
- action: restart
path: ./backend/app/session/schemas.py
- action: restart
path: ./backend/app/session/models.py
- action: restart
path: ./backend/app/session/enums.py
redis:
image: redis:latest
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 1s
timeout: 3s
retries: 5
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis_data:/data
backend:
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- ./backend/.env
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "8000:8000"
environment:
- SUPABASE_URL=http://host.docker.internal:54321
- DATABASE_URL=postgresql+asyncpg://postgres:postgres@host.docker.internal:54322/postgres
- REDIS_URL=redis://redis:6379/0
volumes:
- ./backend:/app
- backend_packages:/app/.venv
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request, sys;
res = urllib.request.urlopen('http://localhost:8000/committees/health', timeout=3);
sys.exit(0) if res.getcode() == 200 else sys.exit(1); "]
interval: 30s
timeout: 5s
retries: 3
start_period: 50s
start_interval: 1s
volumes:
packages:
backend_packages:
redis_data: