-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
64 lines (58 loc) · 1.24 KB
/
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
64
services:
db:
container_name: db
env_file:
- .env
image: postgres
restart: always
ports:
- 5432:5432
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
- "postgres_host_auth_method=trust"
networks:
- mynet
healthcheck:
test: ["CMD", "pg_isready", "-U", "${DB_USER}"]
interval: 5s
timeout: 2s
retries: 5
app:
container_name: app
env_file:
- .env
build: .
command: bash -c "alembic upgrade head && uvicorn main:app --host 0.0.0.0 --port 8000 --reload"
volumes:
- .:/app
ports:
- 8000:8000
depends_on:
db:
condition: service_healthy
links:
- db:db
restart: always
networks:
- mynet
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
# pgadmin:
# container_name: pgadmin
# image: dpage/pgadmin4
# env_file:
# - .env
# environment:
# - PGADMIN_DEFAULT_EMAIL=${PGADMIN_EMAIL}
# - PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD}
# ports:
# - 5050:80
# depends_on:
# - db
networks:
mynet:
driver: bridge