-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
109 lines (107 loc) · 3.2 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
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
volumes:
database-data:
driver: local
pgbackrest-repo:
driver: local
networks:
local:
driver: 'bridge'
services:
database:
image: ghcr.io/bhidapa/heltin-database
build:
context: .
dockerfile: ./database/Dockerfile
networks:
- local
environment:
- POSTGRES_PORT=${POSTGRES_PORT}
- PGPORT=${POSTGRES_PORT} # for postgres client utilities (like psql)
- PGBACKREST_PG1_PORT=${POSTGRES_PORT} # for pgBackRest
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- database-data:/var/lib/postgresql/data
- pgbackrest-repo:/var/lib/pgbackrest
- ${PGBACKREST_CONF_PATH}:/etc/pgbackrest/pgbackrest.conf
healthcheck:
test: psql --set=ON_ERROR_STOP=1 --username=$$POSTGRES_USER --dbname=$$POSTGRES_DB --command='select 1 from public.user;' > /dev/null 2>&1 || exit 1
interval: 7s
timeout: 3s
command:
- postgres
- -c
- jit=off
graphql:
image: ghcr.io/bhidapa/heltin-graphql
build:
context: .
dockerfile: ./graphql/Dockerfile
networks:
- local
environment:
- POSTGRES_HOST=database
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_SCHEMAS=${POSTGRES_SCHEMAS}
- POSTGRES_SESSION_TABLE_SCHEMA=${POSTGRES_SESSION_TABLE_SCHEMA}
- WATCH=t
- SESSION_SECRET=${SESSION_SECRET}
- GRAPHQL_ROUTE=/graphql
- GRAPHIQL_ROUTE=/graphiql
- GRAPHQL_PORT=${GRAPHQL_PORT}
healthcheck:
test: 'curl -f -H "Content-Type: application/json" -d ''{ "query": "query healthcheck { viewer { id } }" }'' http://localhost:$$GRAPHQL_PORT$$GRAPHQL_ROUTE || exit 1'
interval: 7s
timeout: 3s
depends_on:
database:
condition: service_healthy
server:
image: ghcr.io/bhidapa/heltin-server
build:
context: .
dockerfile: ./server/Dockerfile
networks:
- local
environment:
- POSTGRES_HOST=database
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- SESSION_SECRET=${SESSION_SECRET}
- GOTENBERG_HOST=gotenberg
- GOTENBERG_PORT=${GOTENBERG_PORT}
- GRAPHQL_ENDPOINT=http://graphql:${GRAPHQL_PORT}/graphql
- FILE_DIR=/var/heltin-data
volumes:
- ${FILE_DIR}:/var/heltin-data
healthcheck:
test: curl -f http://localhost:$$SERVER_PORT/index.html?healthcheck || exit 1
interval: 7s
timeout: 3s
depends_on:
database:
condition: service_healthy
graphql:
condition: service_healthy
# is indeed used, but not a critical service
# gotenberg:
# condition: service_healthy
gotenberg:
image: thecodingmachine/gotenberg:7
networks:
- local
environment:
- GOTENBERG_PORT=${GOTENBERG_PORT}
healthcheck:
test: curl -f http://localhost:$$GOTENBERG_PORT/health || exit 1
interval: 7s
timeout: 3s
command:
- gotenberg
- --api-port-from-env=GOTENBERG_PORT