-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
48 lines (45 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
services:
app:
build: ./
restart: unless-stopped
ports:
- 5000:80
environment:
- FLASK_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://zug:zug@postgres:5432/zug
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost" ]
start_period: 10s
interval: 5m
timeout: 5s
retries: 3
cron:
build: ./
restart: unless-stopped
environment:
- FLASK_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://zug:zug@postgres:5432/zug
depends_on:
postgres:
condition: service_healthy
command: sh -c "bash /root/create_env.sh; cron -f & touch /var/log/cron.log && tail -f /var/log/cron.log"
postgres:
image: postgres:alpine
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=zug
- POSTGRES_DB=zug
- POSTGRES_USER=zug
volumes:
- ./db_backup:/docker-entrypoint-initdb.d
# Uncomment for database persistence
# - database:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U zug" ]
start_period: 10s
interval: 5s
timeout: 5s
retries: 10
volumes:
database: