generated from mlibrary/python-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
52 lines (52 loc) · 1.13 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
services:
app:
depends_on:
- db
build:
context: .
target: development
dockerfile: Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
DEV: ${DEV:-false}
POETRY_VERSION: ${POETRY_VERSION:-1.8.4}
env_file:
- .env
volumes:
- .:/app
tty: true
stdin_open: true
api:
depends_on:
- db
build:
context: .
target: development
dockerfile: Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
DEV: ${DEV:-false}
POETRY_VERSION: ${POETRY_VERSION:-1.8.4}
env_file:
- .env
volumes:
- .:/app
tty: true
stdin_open: true
command: ["poetry", "run", "fastapi", "dev", "dor/entrypoints/api/main.py", "--host", "0.0.0.0", "--port", "8000"]
ports:
- ${API_PORT:-8000}:8000
db:
ports:
- "5432:5432"
image: postgres:17-alpine
environment:
- POSTGRES_PASSWORD=postgres
- PGDATA=/var/lib/postgresql/data/db
volumes:
- db-data:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
volumes:
db-data: