-
Notifications
You must be signed in to change notification settings - Fork 21
/
docker-compose.yml
60 lines (56 loc) · 1.38 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
59
60
version: "3.9"
services:
gunicorn:
container_name: gunicorn
build: .
image: masalim2/balsam
restart: always
ports:
- ${SERVER_PORT}:${SERVER_PORT}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
# Vars in env_file are exported to the containers
# Vars in ".env" specifically are also usable in the compose file as ${VAR}
env_file: ".env"
environment:
SERVER_PORT: ${SERVER_PORT}
BALSAM_LOG_DIR: ${BALSAM_LOG_DIR}
volumes:
- "${BALSAM_LOG_DIR}:/balsam/log"
- "./balsam:/balsam/balsam:ro"
- "./tests:/balsam/tests:ro"
- "${PWD}/${GUNICORN_CONFIG_FILE}:/balsam/gunicorn.conf.py:ro" # Must be abs path
postgres:
container_name: postgres
image: postgres
restart: always
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: balsam
volumes:
- "pgdata:/var/lib/postgresql/data"
command: "-c log_min_duration_statement=0"
logging:
options:
max-size: "50m"
max-file: "5"
driver: "json-file"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 6
redis:
container_name: redis
image: redis
restart: always
ports:
- 6379:6379
volumes:
pgdata: