forked from graphile/bootstrap-react-apollo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
102 lines (95 loc) · 2.21 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
version: "3.7"
services:
# postgres db
db:
container_name: graphiledemo-db
image: graphiledemo-db
build:
context: ./db
volumes:
# all our database data gets it's one volume
- db-volume:/var/lib/postgresql/data
# scripts & data are needed to run dump-schema after migrations
- ./scripts:/scripts
- ./data:/data
env_file:
- ./.env
networks:
- default
ports:
# postgres default
- 5432:5432
# runs express serving graphql & graphiql and also runs client (react) dev server
db-migrate:
image: node:12
container_name: db-migrate
env_file:
- ./.env
command: ["npm", "run", "start"]
volumes:
- ./db-migrate:/home/node/
# access to db scripts & migrations
- ./db/migrations:/home/node/db/migrations
- ./db/scripts:/home/node/db/scripts
# use seperate volume for node_modules, makes it easier to manage and faster to reset
- node_modules_db-migrate:/home/node/node_modules
working_dir: /home/node
nuxtjs:
image: node:12
env_file:
- ./.env
volumes:
- ./server/:/home/node/
- ./data:/home/node/data
- node_modules_nuxtjs:/home/node/node_modules
working_dir: /home/node
container_name: nuxtjs-vue-website
stdin_open: true
tty: true
networks:
- default
ports:
# express server, for / and /graphiql
- 8080:${PORT}
# node debugger port
- 9229:9229
command: "npm run dev"
# for debug purposes, so we can poke around in our db
adminer:
image: adminer
environment:
- ADMINER_PLUGINS=edit-foreign
networks:
- default
ports:
- 8888:8080
graphiql:
container_name: postgraphile
restart: always
image: graphile/postgraphile
env_file:
- ./.env
depends_on:
- db
networks:
- default
ports:
- 5433:5433
command:
[
"postgraphile",
"--connection",
"${DATABASE_URL}",
"--schema",
"app_public",
"--port",
"5433",
"--enhance-graphiql",
]
networks:
default:
name: graphiledemo-network
volumes:
db-volume:
node_modules_nuxtjs:
node_modules_db-migrate: