forked from testdrivenio/fastapi-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.debug.yml
46 lines (42 loc) · 1.31 KB
/
docker-compose.debug.yml
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
version: '3.4'
services:
backend:
image: app-backend-debug:1.00
build: ./backend
container_name: fastapi-backend-debug
environment:
- DATABASE_URL=postgres://hello_fastapi_dev:hello_fastapi_dev@db:5432/hello_fastapi_dev
- SECRET_KEY=changethis
- FASTAPI_MOUNT_DIR=root # mount web app to host root dir or sub-dir
- PYDEVD_DISABLE_FILE_VALIDATION=1
volumes:
- ./backend:/app
- ./frontend/dist:/app/dist
command: sh -c "pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -m uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload --log-config=log_config.yml"
ports:
- 8000:8000
- 5678:5678
depends_on:
- db
frontend:
image: app-frontend:1.00
build: ./frontend
container_name: vue-frontend
restart: always
volumes:
- ./frontend:/app
- /app/node_modules
ports:
- 8080:8080 # 8200:8080 publish port 8080 (inside container) as 8200 on host
db:
image: postgres:15.1
environment:
- POSTGRES_USER=hello_fastapi_dev
- POSTGRES_PASSWORD=hello_fastapi_dev
- POSTGRES_DB=hello_fastapi_dev
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- 5432:5432
volumes:
postgres_data: