-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
63 lines (59 loc) · 1.33 KB
/
docker-compose.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
version: '3.8'
services:
development:
container_name: fastapi_test-dev
build:
context: .
target: development
entrypoint: /bin/sh -xec
command:
- |
wait-for postgres_fastapi:5432
python -m debugpy --listen 0.0.0.0:5678 -m uvicorn fastapi_test.app:app --reload --host 0.0.0.0
ports:
- 8000:8000
- 5678:5678
networks:
- fastapi-network
depends_on:
- postgres_fastapi
volumes:
- .:/usr/src
environment:
- INSTALL_DEV=true
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_SERVER=postgres_fastapi
- POSTGRES_DB=fastapi
postgres_fastapi:
container_name: postgres_fastapi
image: postgres:latest
environment:
- PGDATA=/data/db
- PGPASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=fastapi
volumes:
- ./.database/postgres_fastapi:/data/db
ports:
- 5432:5432
networks:
- fastapi-network
restart: always
production:
container_name: fastapi_test-prod
build:
context: .
target: production
ports:
- 8000:80
networks:
- fastapi-network
depends_on:
- postgres_fastapi
environment:
- INSTALL_DEV=false
networks:
fastapi-network:
driver: bridge