-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
68 lines (64 loc) · 1.98 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
68 lines (64 loc) · 1.98 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
# docker-compose.dev.yml
services:
survey_api_dev:
build:
context: ./api
dockerfile: Dockerfile
container_name: survey_api_dev
volumes:
- ./api:/root
working_dir: /root
environment:
- MONGO_URL=mongodb://mongodb_dev:27018 # CORRECTED: Match service name
- DATABASE_NAME=survey_db_dev
- SESSION_SECRET_KEY=a_dev_secret_key_for_sessions
- DEV_UI_HOST_PORT_VITE=5174 # For CORS settings.py
- DEV_NGINX_PROXY_HOST_PORT=8080 # For CORS settings.py
ports:
- "8001:8000"
depends_on:
- mongodb_dev # CORRECTED: Match service name
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--reload-dir", "/root/app"]
restart: unless-stopped
stop_grace_period: 0s
survey_ui_dev:
image: node:22-slim
container_name: survey_ui_dev
working_dir: /ui
volumes:
- ./ui:/ui
- /ui/node_modules
environment:
- CHOKIDAR_USEPOLLING=true
# - VITE_API_DIRECT_URL=http://localhost:8001 # Uncomment if UI needs to hit API directly, not via nginx_dev
ports:
- "5174:5173"
command: >
sh -c "if [ ! -d 'node_modules' ] || [ ! -f 'node_modules/.vite/deps/_metadata.json' ]; then npm install; fi &&
npm run dev -- --host 0.0.0.0 --port 5173"
restart: unless-stopped
stop_grace_period: 0s
nginx_dev:
image: nginx:alpine
container_name: nginx_dev # Kept as per your file
ports:
- "8080:80"
volumes:
- ./ui/nginx/nginx.dev.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- survey_api_dev
- survey_ui_dev
restart: unless-stopped
stop_grace_period: 0s
mongodb_dev: # Kept name as per your file
image: mongo:latest
container_name: mongodb_dev
ports:
- "127.0.0.1:27018:27018"
volumes:
- mongodb_dev_data:/data/db
restart: unless-stopped
stop_grace_period: 0s
command: ["mongod", "--port", "27018"]
volumes:
mongodb_dev_data: