-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.debug.yml
More file actions
60 lines (54 loc) · 1.62 KB
/
docker-compose.debug.yml
File metadata and controls
60 lines (54 loc) · 1.62 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
version: '3.8'
services:
postgres:
build:
context: .
dockerfile: postgres.dockerfile
image: img-test-db
container_name: ctn-test-db
networks:
- testauth_network
env_file: .env
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATA: ${PGDATA}
volumes:
- vol-test-auth-db:/data/postgres-testdb
ports:
- "5431:5432"
expose:
- 5431
restart: unless-stopped
# fastAPI
test-api:
env_file: .env
networks:
- test_network
environment:
- POSTGRES_SERVER=postgres # db service name
image: img-test-api-v1
container_name: ctn-test-api-v1
command: bash -c 'while !</dev/tcp/postgres/5432; do sleep 1; done; alembic upgrade head; uvicorn app.main:app --host 0.0.0.0'
# command: ["sh", "-c", "pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload"]
# command: ["sh", "-c", 'while !</dev/tcp/postgres/5432; do sleep 1; done; alembic upgrade head;', "pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -m uvicorn main:app --host 0.0.0.0"]
build:
context: .
dockerfile: ./Dockerfile
ports:
- 8002:8000
- 5678:5678
expose:
- 8002
# - 443
# - 80
depends_on:
- postgres
volumes:
vol-test-auth-db:
external: false
networks:
test_network:
name: network-test_default
external: false