-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
45 lines (42 loc) · 999 Bytes
/
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
version: '3'
networks:
mynetwork:
services:
postgres:
image: postgres:latest
container_name: postgres-container
env_file: .env # Don't forget to create a .env file with a POSTGRES_PASSWORD variable containing the password !
ports:
- "5432:5432"
networks:
- mynetwork
fastapi:
build:
context: . # Path to your FastAPI app's Dockerfile.alembic and application code
container_name: fastapi-container
env_file: .env
volumes:
- .:/src
command: ["./entrypoint.sh"]
ports:
- "8000:8000"
depends_on:
- postgres
networks:
- mynetwork
alembic:
build:
context: src/API
dockerfile: Dockerfile.alembic
container_name: alembic-container
env_file: .env
environment:
ALEMBIC_MODE: init # init | upgrade | reset | none
command: ["./src/API/entrypoint.sh"]
volumes:
- .:/src/API
depends_on:
- postgres
- fastapi
networks:
- mynetwork