-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
137 lines (128 loc) · 3.2 KB
/
compose.yaml
File metadata and controls
137 lines (128 loc) · 3.2 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# ${XXXXX} means variable XXXXX is stored in the .env file
services:
frontend:
depends_on:
backend:
condition: service_healthy
clamav-rest:
condition: service_healthy
build:
context: ./frontend
env_file: .env
networks:
- frontend
ports:
- ${FRONTEND_PORT}:${FRONTEND_PORT}
- ${FRONTEND_HTTPS_PORT}:${FRONTEND_HTTPS_PORT}
restart: unless-stopped
backend:
depends_on:
postgres:
condition: service_healthy
build:
context: ./backend
env_file: .env
command: >
bash -c "python backend/app/postgres_db.py
&& fastapi run backend/app/main.py --port ${BACKEND_PORT} --workers 4"
networks:
- frontend
- backend
ports:
- ${BACKEND_PORT}:${BACKEND_PORT}
volumes:
- pdf_uploads:${UPLOAD_DIR}
- ./backend/alembic.ini:/src/backend/alembic.ini
- ./backend/alembic/:/src/backend/alembic
post_start:
- command: sh -c "alembic -c /src/backend/alembic.ini upgrade head"
restart: unless-stopped
healthcheck:
test: /usr/bin/curl --fail http://localhost:${BACKEND_PORT}/api/healthcheck || exit 1
interval: 30s
start_period: 30s
start_interval: 5s
timeout: 10s
retries: 10
postgres:
build:
context: ./postgres
env_file: .env
networks:
- backend
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_backups:/backups
post_start:
- command: sh -c "./dump_database.sh"
labels:
deck-chores.dump-database.command: sh -c "./dump_database.sh"
deck-chores.dump-database.interval: daily
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 30s
start_period: 30s
start_interval: 5s
timeout: 10s
retries: 10
# ClamAV virus scanner with REST API
clamav-rest:
build:
context: ./clamav-rest
env_file: .env
environment:
MAX_FILE_SIZE: 100M
networks:
- backend
ports:
- ${CLAMAV_PORT}:${CLAMAV_PORT}
volumes:
- clamav_db:/var/lib/clamav
- clamav_data:/clamav/data
restart: unless-stopped
healthcheck:
test: curl --fail http://localhost:${CLAMAV_PORT} || exit 1
interval: 30s
start_period: 30s
start_interval: 5s
timeout: 10s
retries: 10
# Adminer: Database management dashboard
adminer:
image: adminer
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
networks:
- frontend
- backend
ports:
- ${ADMINER_PORT}:8080
# Deck-chores: Cron Scheduler for docker containers
deck-chores:
image: ghcr.io/funkyfuture/deck-chores:1
deploy:
mode: global
environment:
TIMEZONE: Europe/Helsinki
DEFAULT_FLAGS: noservice
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- postgres_backups:/mnt/backups
restart: unless-stopped
networks:
frontend:
driver: bridge
driver_opts:
com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
backend:
volumes:
pdf_uploads:
postgres_data:
postgres_backups:
clamav_db:
clamav_data: