-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose-prod.yml
141 lines (133 loc) · 4.27 KB
/
docker-compose-prod.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
version: "3.7"
services:
zendro-keycloak-postgres:
container_name: zendro-keycloak-postgres
image: postgres
volumes:
- keycloak_pg_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${KEYCLOAK_DATABASE_NAME}
POSTGRES_USER: ${KEYCLOAK_DATABASE_USER}
POSTGRES_PASSWORD: ${KEYCLOAK_DATABASE_PASSWORD}
networks:
zendro:
zendro-keycloak:
container_name: zendro-keycloak
image: quay.io/keycloak/keycloak:19.0.1
entrypoint: ["/opt/keycloak/bin/kc.sh", "start"]
ports:
- 8081:8080
environment:
KC_DB: ${KEYCLOAK_DATABASE_VENDOR}
KC_DB_URL_HOST: ${KEYCLOAK_DATABASE_HOST}
KC_DB_URL_DATABASE: ${KEYCLOAK_DATABASE_NAME}
KC_DB_USERNAME: ${KEYCLOAK_DATABASE_USER}
KC_DB_SCHEMA: ${KEYCLOAK_DATABASE_SCHEMA}
KC_DB_PASSWORD: ${KEYCLOAK_DATABASE_PASSWORD}
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN_USER}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
KC_HTTP_RELATIVE_PATH: ${KEYCLOAK_HTTP_RELATIVE_PATH}
KC_HOSTNAME: ${KEYCLOAK_HOSTNAME}
KC_HOSTNAME_PORT: ${KEYCLOAK_HOSTNAME_PORT}
# The following options are to circumvent setting up TLS. Make sure to set
# up TLS and expose your keycloak endpoints through https
# (https://www.keycloak.org/server/enabletls) in a production envionment.
# In case you want to use a reverse proxy please check out the keycloak
# documentation on how to use it behind a reverse proxy
# (https://www.keycloak.org/server/reverseproxy).
KC_HTTP_ENABLED: "true"
KC_HOSTNAME_STRICT_HTTPS: "false"
depends_on:
- zendro-keycloak-postgres
networks:
zendro:
zendro-graphql-server:
container_name: zendro-graphql-server
depends_on:
- zendro-keycloak
build:
context: ./contexts
dockerfile: Dockerfile.graphql_server
# Using ports in this way is a security concern. Please consider using e.g. a reverseproxy
ports:
- 3000:3000
volumes:
- ./graphql-server:/usr/graphql-server
# override default default config with Starterpack config
- ./config/data_models_storage_config.json:/usr/graphql-server/config/data_models_storage_config.json
- ./graphiql-auth/.env.development:/usr/graphiql-auth/.env.development
- ./graphiql-auth/.env.production:/usr/graphiql-auth/.env.production
- ./single-page-app/.env.development:/usr/single-page-app/.env.development
- ./single-page-app/.env.production:/usr/single-page-app/.env.production
# Await POSTGRES role and DB creation, migrate schema, then start web
# server:
networks:
zendro:
datastores:
command:
- /bin/sh
- -c
- |
npm install
node migrateDbAndStartServer.js
zendro-spa:
container_name: zendro-spa
# Workaround. See https://github.com/facebook/create-react-app/issues/8688
stdin_open: true
depends_on:
- zendro-graphql-server
build:
context: ./contexts
dockerfile: Dockerfile.spa
# Using ports in this way is a security concern. Please consider using e.g. a reverseproxy
ports:
- 8080:8080
volumes:
- ./single-page-app:/usr/single-page-app
- ./data_model_definitions:/usr/data_model_definitions
networks:
zendro:
# Install dependencies and start single-page-app-server in development
# mode.
command:
- /bin/sh
- -c
- |
rm -rf .next
rm -rf out
yarn install
yarn build
yarn start
zendro-graphiql:
container_name: zendro-graphiql
# Workaround. See https://github.com/facebook/create-react-app/issues/8688
stdin_open: true
depends_on:
- zendro-graphql-server
build:
context: ./contexts
dockerfile: Dockerfile.graphiql
# Using ports in this way is a security concern. Please consider using e.g. a reverseproxy
ports:
- 7070:7070
volumes:
- ./graphiql-auth:/usr/graphiql-auth
# Install dependencies and start single-page-app-server in development
# mode.
networks:
zendro:
command:
- /bin/sh
- -c
- |
rm -rf .next
rm -rf out
yarn install
yarn build
yarn start
volumes:
zendro_db_data:
keycloak_pg_data:
networks:
zendro:
datastores: