-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (45 loc) · 1.03 KB
/
docker-compose.yml
File metadata and controls
49 lines (45 loc) · 1.03 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
version: "3.9"
services:
postges_db:
container_name: fastapi-db
image: postgres
restart: always
ports:
- 5433:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
POSTGRES_DB: fastapi_db
volumes:
- ./db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 3
app:
container_name: fastapi-container
build:
# context: .
dockerfile: Dockerfile
ports:
- 8000:8000
env_file:
- ".env"
volumes:
- .:/fastapi-app
depends_on:
postges_db:
condition: service_healthy
command: bash -c "alembic upgrade head && uvicorn app.main:app --reload --host 0.0.0.0 --port 8000"
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4
restart: always
ports:
- 5050:80
environment:
PGADMIN_DEFAULT_EMAIL: admin@gmail.com
PGADMIN_DEFAULT_PASSWORD: admin
depends_on:
- postges_db