This repository has been archived by the owner on Jun 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
82 lines (76 loc) · 2.33 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
version: "3.3"
services:
db:
container_name: cdtn_backoffice_db
image: postgres:12-alpine
restart: always
environment:
# The JWT secret is used whithin the api.login() function:
PGRST_JWT_SECRET: ${PGRST_JWT_SECRET}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgre-data:/var/lib/postgresql/data
- ./backups:/backups
# https://postgrest.org/en/stable/install.html#containerized-postgrest-and-db-with-docker-compose
postgrest:
container_name: cdtn_backoffice_postgrest
image: postgrest/postgrest:v6.0.2
# image: hughjfchen/hughjfchen:postgrest-aarch64-6.0.2 # for arm64
restart: always
environment:
PGRST_DB_ANON_ROLE: ${PGRST_DB_ANON_ROLE}
PGRST_DB_SCHEMA: ${PGRST_DB_SCHEMA}
PGRST_DB_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
PGRST_JWT_SECRET: ${PGRST_JWT_SECRET}
depends_on:
- db
api:
container_name: cdtn_backoffice_api
build:
context: ./packages/api
args:
API_PORT: ${API_PORT}
DB_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
NODE_ENV: ${NODE_ENV}
POSTGREST_URI: http://postgrest:3000
restart: always
ports:
- ${API_PORT}:${API_PORT}
depends_on:
- postgrest
app:
container_name: cdtn_backoffice_app
build:
context: ./packages/app
args:
API_DOMAIN: ${API_DOMAIN}
API_PORT_PUBLIC: ${API_PORT_PUBLIC}
API_SCHEME: ${API_SCHEME}
API_URI_DOCKER: http://api:${API_PORT}
CDTN_API_URL: ${CDTN_API_URL}
DB_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
NODE_ENV: ${NODE_ENV}
APP_PORT: ${APP_PORT}
restart: always
ports:
- ${APP_PORT}:${APP_PORT}
depends_on:
- api
master:
container_name: cdtn_backoffice_master
# Keep the container up:
# https://stackoverflow.com/a/55953120/2736233
tty: true
build:
context: .
environment:
DB_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
NODE_ENV: ${NODE_ENV}
PGRST_JWT_SECRET: ${PGRST_JWT_SECRET}
POSTGRES_DB: ${POSTGRES_DB}
depends_on:
- db
volumes:
postgre-data: