-
Notifications
You must be signed in to change notification settings - Fork 16
/
docker-compose.yml
58 lines (47 loc) · 1.19 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
version: '3.8'
volumes:
databaseVolume:
services:
database:
image: postgres:alpine
restart: on-failure
healthcheck:
test: ['CMD', 'pg_isready -U postgres']
interval: 30s
timeout: 10s
retries: 10
ports:
- '${DB_PORT}:${DB_PORT}'
env_file:
- .env
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_HOST: ${DB_HOST}
POSTGRES_PORT: ${DB_PORT}
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASS}
volumes:
- databaseVolume:/var/lib/postgresql
- ./init-user-db.sh:/docker-entrypoint-initdb.d/init-user-db.sh:ro
app:
build:
context: .
target: build
entrypoint: sh "/entrypoint.sh"
environment:
DB_NAME: ${DB_NAME}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASS}
POETRY_CACHE_DIR: '/tmp/'
WAIT_FOR_DB: 1
ports:
- '${PORT}:80'
volumes:
- ./app:/opt/project/app
- ./Makefile:/opt/project/Makefile
- ./pyproject.toml:/opt/project/pyproject.toml
- ./poetry.lock:/opt/project/poetry.lock
- ./setup.cfg:/opt/project/setup.cfg
command: "uvicorn app.main:app --host 0.0.0.0 --port 80"