-
Notifications
You must be signed in to change notification settings - Fork 248
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (80 loc) · 3.73 KB
/
docker-compose.yml
File metadata and controls
86 lines (80 loc) · 3.73 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
services:
app:
build: .
restart: unless-stopped
ports:
- ${APP_HOST_ADDRESS:?'APP_HOST_ADDRESS is required'}:${APP_HOST_PORT:?'APP_HOST_PORT is required'}:${APP_CONTAINER_PORT}
expose:
- ${APP_CONTAINER_PORT}
environment:
- NAME=${APP_NAME:?'APP_NAME is required'}
- DEBUG=${APP_DEBUG:?'APP_DEBUG is required'}
- ADDRESS=${APP_CONTAINER_ADDRESS:?'APP_CONTAINER_ADDRESS is required'}
- PORT=${APP_CONTAINER_PORT:?'APP_CONTAINER_PORT is required'}
- RELOAD=${APP_RELOAD:?'APP_RELOAD is required'}
- API_KEY=${API_KEY:?'API_KEY is required'}
- APP_ENABLE_INTERACTIONS=${APP_ENABLE_INTERACTIONS:?'APP_ENABLE_INTERACTIONS is required'}
- APP_ENABLE_LEARNERS=${APP_ENABLE_LEARNERS:?'APP_ENABLE_LEARNERS is required'}
- DB_HOST=${CONST_POSTGRESQL_SERVICE_NAME:?'CONST_POSTGRESQL_SERVICE_NAME is required'}
- DB_PORT=${CONST_POSTGRESQL_DEFAULT_PORT:?'CONST_POSTGRESQL_DEFAULT_PORT is required'}
- DB_NAME=${POSTGRES_DB:?'POSTGRES_DB is required'}
- DB_USER=${POSTGRES_USER:?'POSTGRES_USER is required'}
- DB_PASSWORD=${POSTGRES_PASSWORD:?'POSTGRES_PASSWORD is required'}
depends_on:
postgres:
condition: service_healthy
postgres:
# A portable solution: download image from Docker Hub.
# image: postgres:18.3-alpine
# A less portable solution: download image through a cache proxy provided by the University.
# This solution is necessary to avoid "Too many requests" errors.
# This solution won't work outside the University network.
image: harbor.pg.innopolis.university/docker-hub-cache/postgres:18.3-alpine
restart: unless-stopped
environment:
- POSTGRES_DB=${POSTGRES_DB:?'POSTGRES_DB is required'}
- POSTGRES_USER=${POSTGRES_USER:?'POSTGRES_USER is required'}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?'POSTGRES_PASSWORD is required'}
ports:
- ${POSTGRES_HOST_ADDRESS:?'POSTGRES_HOST_ADDRESS is required'}:${POSTGRES_HOST_PORT:?'POSTGRES_HOST_PORT is required'}:${CONST_POSTGRESQL_DEFAULT_PORT:?'CONST_POSTGRESQL_DEFAULT_PORT is required'}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/app/data/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:?'POSTGRES_USER is required'} -d ${POSTGRES_DB:?'POSTGRES_DB is required'}",
]
interval: 5s
timeout: 5s
retries: 5
pgadmin:
# A portable solution: download image from Docker Hub.
# image: dpage/pgadmin4:latest
# A less portable solution: download image through a cache proxy provided by the University.
# This solution is necessary to avoid "Too many requests" errors.
# This solution won't work outside the University network.
image: harbor.pg.innopolis.university/docker-hub-cache/dpage/pgadmin4:latest
restart: unless-stopped
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_EMAIL:?'PGADMIN_EMAIL is required'}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD:?'PGADMIN_PASSWORD is required'}
ports:
- ${PGADMIN_HOST_ADDRESS:?'PGADMIN_HOST_ADDRESS is required'}:${PGADMIN_HOST_PORT:?'PGADMIN_HOST_PORT is required'}:80
depends_on:
postgres:
condition: service_healthy
caddy:
build: frontend/
depends_on:
- app
environment:
- CADDY_CONTAINER_PORT=${CADDY_CONTAINER_PORT:?'CADDY_CONTAINER_PORT is required'}
- APP_CONTAINER_PORT=${APP_CONTAINER_PORT:?'APP_CONTAINER_PORT is required'}
ports:
- ${CADDY_HOST_ADDRESS:?'CADDY_HOST_ADDRESS is required'}:${CADDY_HOST_PORT:?'CADDY_HOST_PORT is required'}:${CADDY_CONTAINER_PORT}
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
volumes:
postgres_data: