forked from Zendro-dev/ZendroStarterPack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yml
119 lines (112 loc) · 3.24 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
version: "3.7"
services:
zendro_postgres:
container_name: zendroStarterPack_postgres
build:
context: ./contexts
dockerfile: Dockerfile.postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5433:5432
volumes:
- zendro_db_data:/var/lib/postgresql/data
networks:
- backend
zendro_graphql_server:
container_name: zendroStarterPack_graphql-server
depends_on:
- zendro_postgres
build:
context: ./contexts
dockerfile: Dockerfile.graphql_server
environment:
PORT: "3000"
JQ_PATH: /usr/bin/jq
NODE_JQ_SKIP_INSTALL_BINARY: "true"
REQUIRE_SIGN_IN: "true"
# 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
networks:
- backend
# Await POSTGRES role and DB creation, migrate schema, then start web
# server:
command:
- /bin/sh
- -c
- |
npm install
./migrateDbAndStartServer.sh
zendro_spa:
container_name: zendroStarterPack_spa
# Workaround. See https://github.com/facebook/create-react-app/issues/8688
stdin_open: true
depends_on:
- zendro_postgres
- 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
environment:
# Set your production environment variables here or in ./single-page-app/.env.production
PORT: "8080"
ZENDRO_DATA_MODELS: './data_model_definitions'
volumes:
- ./single-page-app:/usr/single-page-app
- ./data_model_definitions:/usr/single-page-app/data_model_definitions
# 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 export
yarn serve
zendro_graphiql:
container_name: zendroStarterPack_graphiql-auth
# Workaround. See https://github.com/facebook/create-react-app/issues/8688
stdin_open: true
depends_on:
- zendro_postgres
- 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:
- 7000:7000
environment:
# Set your production environment variables here
PORT: "7000"
REACT_APP_SERVER_URL: "http://localhost:3000/graphql"
REACT_APP_LOGIN_URL: "http://localhost:3000/login"
REACT_APP_SERVER_METAQUERY_URL: "http://localhost:3000/meta_query"
volumes:
- ./graphiql-auth:/usr/graphiql-auth
# Install dependencies and start single-page-app-server in development
# mode.
networks:
- backend
command:
- /bin/sh
- -c
- |
npm install
npm start
volumes:
zendro_db_data:
networks:
backend: