-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
113 lines (105 loc) · 2.88 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
110
111
112
113
version: '3.5'
services:
proxy:
# image: nginx:latest
build:
context: $PWD/api/.
target: base
restart: unless-stopped
ports:
- 3000:80
volumes:
- $PWD/config/stage/dev/nginx/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro
- app-build:/usr/share/nginx/html:ro
app:
image: node:14
restart: unless-stopped
user: node
volumes:
- app-build:/usr/src/output
- .:/usr/src/service
environment:
NODE_ENV: development
working_dir: /usr/src/service
command: yarn watch
api-db:
image: postgres:latest
restart: unless-stopped
environment:
POSTGRES_USER: $API_DB_USER
POSTGRES_DB: $API_DB_NAME
POSTGRES_PASSWORD: $API_DB_PASSWORD
volumes:
- api-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "$API_DB_USER", "-d", "$API_DB_NAME"]
interval: 10s
start_period: 30s
api:
build: $PWD/api/.
restart: unless-stopped
depends_on:
api-db:
condition: service_healthy
environment:
DB_HOST: api-db
DB_USER: $API_DB_USER
DB_PASSWORD: $API_DB_PASSWORD
DB_NAME: $API_DB_NAME
volumes:
- $PWD/api/src:/usr/local/openresty/site/lualib
# Keycloak Identity and Access Management
keycloak-db:
image: postgres:latest
restart: unless-stopped
environment:
POSTGRES_USER: $KEYCLOAK_DB_USER
POSTGRES_DB: $KEYCLOAK_DB_NAME
POSTGRES_PASSWORD: $KEYCLOAK_DB_PASSWORD
volumes:
- keycloak-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "$KEYCLOAK_DB_USER", "-d", "$KEYCLOAK_DB_NAME"]
interval: 10s
start_period: 30s
keycloak:
image: jboss/keycloak:15.0.2
restart: unless-stopped
depends_on:
keycloak-db:
condition: service_healthy
volumes:
- $PWD/keycloak_theme:/opt/jboss/keycloak/themes/custom
- $PWD/config/stage/dev/realms/acme-demo.json:/tmp/acme-demo.json
environment:
DB_ADDR: keycloak-db
DB_DATABASE: $KEYCLOAK_DB_NAME
DB_PASSWORD: $KEYCLOAK_DB_PASSWORD
DB_USER: $KEYCLOAK_DB_USER
DB_VENDOR: postgres
JDBC_PARAMS: 'connectTimeout=30'
# KEYCLOAK_FRONTEND_URL: "http://0.0.0.0:3000/auth"
KEYCLOAK_IMPORT: /tmp/acme-demo.json
KEYCLOAK_LOGIN_THEME: custom
KEYCLOAK_PASSWORD: $KEYCLOAK_PASSWORD
KEYCLOAK_USER: $KEYCLOAK_USER
PROXY_ADDRESS_FORWARDING: "true"
# db_admin:
# image: dpage/pgadmin4:latest
# ports:
# - 5050:5050
# volumes:
# - /tmp/servers.json:/pgadmin4/servers.json
# environment:
# PGADMIN_DEFAULT_EMAIL:[email protected]
# PGADMIN_DEFAULT_PASSWORD: SuperSecret
# PGADMIN_LISTEN_PORT: 5050
volumes:
api-db:
keycloak-db:
app-build:
driver: local
driver_opts:
type: "tmpfs"
device: "tmpfs"
o: "size=256m,uid=1000"