-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
123 lines (120 loc) · 3.24 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
114
115
116
117
118
119
120
121
122
123
version: "3.9"
services:
# Deploy the broker.
rabbitmq_server:
image: rabbitmq:3-management
ports:
# Expose the port for the worker to add/get tasks
- 5672:5672
# OPTIONAL: Expose the GUI port
- 15672:15672
# Deploy the worker
worker:
# Build using the worker Dockerfile
build:
context: .
dockerfile: worker.Dockerfile
# Need to access the database
# OPTIONAL: If you worker needs to access your db that is deployed
# locally, then make the network mode as host.
network_mode: host
# Pass the rabbitmq_uri as env varible in order to
# connect to our service
environment:
# NOTE: Below we are using 127.0.0.1 because this container
# will run on the host network, thus it will have access to the
# host network.
# If it would not have run locally, we would have had to
# connect using the service name like following:
# amqp:rabbitmq_server:5672
rabbitmq_uri: amqp://127.0.0.1:5672
# Make it wait for rabbitmq deployment
depends_on:
- rabbitmq_server
volumes:
- ./:/app
watchdog:
# Build using the worker Dockerfile
build:
context: .
dockerfile: watch.Dockerfile
# Need to access the database
# OPTIONAL: If you worker needs to access your db that is deployed
# locally, then make the network mode as host.
network_mode: host
# Pass the rabbitmq_uri as env varible in order to
# connect to our service
environment:
# NOTE: Below we are using 127.0.0.1 because this container
# will run on the host network, thus it will have access to the
# host network.
# If it would not have run locally, we would have had to
# connect using the service name like following:
# amqp:rabbitmq_server:5672
rabbitmq_uri: amqp://127.0.0.1:5672
# Make it wait for rabbitmq deployment
depends_on:
- rabbitmq_server
- worker
volumes:
- ./:/app
restart: unless-stopped
postgres:
image: postgres:10.5
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
logging:
options:
max-size: 10m
max-file: "3"
ports:
- "5432:5432"
volumes:
- ./postgres-data:/var/lib/postgresql/data
# copy the sql script to create tables
- ./sql:/docker-entrypoint-initdb.d
graphql:
container_name: postgraphile
restart: always
image: postgraphile
build:
context: ./graphql
depends_on:
- postgres
ports:
- 5433:5433
command:
[
"--connection",
"postgres://postgres:postgres@postgres:5432/postgres",
"--port",
"5433",
"--schema",
"public",
"--append-plugins",
"postgraphile-plugin-connection-filter,custom-plugin",
"--watch",
]
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
container_name: frontend
volumes:
- ./frontend:/app
- /app/node_modules
environment:
- CHOKIDAR_USEPOLLING=true
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "8000:8000"
container_name: backend
volumes:
- ./:/app