-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
70 lines (65 loc) · 2.41 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
services:
# This is the database to which the all the other components in the stack will connect and interact with
# (but mostly it's PostgREST that is going to be responsible for the bulk of the db traffic)
db:
environment:
# env vars specific to postgres image used on first boot
- POSTGRES_USER=${SUPER_USER}
- POSTGRES_PASSWORD=${SUPER_USER_PASSWORD}
- POSTGRES_DB=${DB_NAME}
# env vars useful for our sql scripts
- SUPER_USER=${SUPER_USER}
- SUPER_USER_PASSWORD=${SUPER_USER_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- DB_ANON_ROLE=${DB_ANON_ROLE}
- DEVELOPMENT=${DEVELOPMENT}
- JWT_SECRET=${JWT_SECRET}
- JWT_LIFETIME=${JWT_LIFETIME}
- PG_VERSION=${PG_VERSION}
- RP_ID=${RP_ID}
- ORIGIN=${ORIGIN}
- DISABLE_USER_VERIFICATION=${DISABLE_USER_VERIFICATION}
volumes:
- db-vol:/var/lib/postgresql/data
# PostgREST instance, is responsible for communicating with the database
# and providing a REST api, (almost) every request that is sent to the database goes through it
postgrest:
image: postgrest/postgrest:v12.0.3
environment:
- PGRST_DB_URI=postgres://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}
- PGRST_DB_SCHEMA=${DB_SCHEMA}
- PGRST_DB_ANON_ROLE=${DB_ANON_ROLE}
- PGRST_DB_POOL=${DB_POOL}
- PGRST_JWT_SECRET=${JWT_SECRET}
- PGRST_MAX_ROWS=${MAX_ROWS}
depends_on:
- db
# OpenResty (Nginx + Lua) instance that sits in front of PostgREST.
# All the requests coming into the system are first hitting this component.
# After some processing/checks and transformation, the request is forwarded
# to PostgREST down the stack.
openresty:
command: ["openresty", "-g", "daemon off; error_log /dev/stderr info;"]
environment:
- DEVELOPMENT=${DEVELOPMENT}
- POSTGREST_HOST=${POSTGREST_HOST}
- POSTGREST_PORT=${POSTGREST_PORT}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- DB_SCHEMA=${DB_SCHEMA}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- COOKIE_SESSION_SECRET=${COOKIE_SESSION_SECRET}
- COOKIE_SESSION_LIFETIME=${COOKIE_SESSION_LIFETIME}
- LISTAN_API_URL=${LISTAN_API_URL}
- LISTAN_JWT_SECRET=${LISTAN_JWT_SECRET}
volumes:
- uploads-vol:/uploads
depends_on:
- postgrest
volumes:
db-vol:
uploads-vol: