forked from sentier-dev/glossary-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
43 lines (42 loc) · 1.26 KB
/
compose.yaml
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
# If you need more help, visit the Docker Compose reference guide at
# https://docs.docker.com/go/compose-spec-reference/
# For examples, see the Awesome Compose repository:
# https://github.com/docker/awesome-compose
services:
glossary_postgres:
image: postgres
shm_size: 1g
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PORT: ${POSTGRES_PORT}
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
glossary_web:
build:
context: .
dockerfile: Dockerfile
environment:
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@glossary_postgres:${POSTGRES_PORT}/${POSTGRES_DB}
API_KEY: ${API_KEY}
SENTRY_DSN: ${SENTRY_DSN}
HOST_IP: "0.0.0.0"
ports:
- "8000:8000"
command: ["python", "-m", "dds_glossary.main"]
depends_on:
glossary_postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/version"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s