-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
153 lines (141 loc) · 3.06 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# ###### In case you forget...
# :ro === :readonly
# for each 'ports' entry -> HOST_PORT:CONTAINER_PORT
services:
all:
image: alpine
command: sh -C "echo start"
platform: linux/amd64
depends_on:
- frontend
- nginx
- server
- session-cache
database:
image: postgres:16.2-bullseye # higher than this?
env_file: .env
environment:
POSTGRES_PASSWORD: example
networks:
- main_app
- scraper
platform: linux/amd64
ports:
- 5432:5432
volumes:
- ./db:/opt/db/scripts
- db_volume:/var/lib/postgresql/data
frontend:
env_file: .env
environment:
EXAMPLE: woof
build:
context: .
dockerfile: app/Dockerfile
target: frontend-dev
networks:
- main_app
platform: linux/amd64
ports:
- "8080:8080"
- "9229:9229"
volumes:
- ./app:/opt/nlpssa-frontend
- /opt/nlpssa-frontend/node_modules
# - ~/.aws:/home/nlpstocksaapp/.aws:ro
nginx:
build:
context: .
dockerfile: nginx-reverse-proxy/Dockerfile
links:
- frontend
- server
# network_mode: host
networks:
- main_app
- scraper
platform: linux/amd64
ports:
- "80:80"
- "443:443"
restart: unless-stopped
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./app/dist/:/etc/nginx/html/
- ./nginx-reverse-proxy/conf/:/etc/nginx/conf.d/:ro
- ./nginx-reverse-proxy/certs:/etc/nginx/certs
command: [ "nginx", "-g", "daemon off;" ]
server:
depends_on:
- database
- session-cache
env_file: .env
environment:
EXAMPLE: woof
WORKERS: 1
build:
context: .
dockerfile: server/Dockerfile
target: server-dev
networks:
- main_app
platform: linux/amd64
ports:
- "3000:3000"
volumes:
- ./server:/opt/nlp-stock-sa/server
# - ~/.aws:/home/nlpstocksaapp/.aws:ro
session-cache:
image: memcached:1.6.10
networks:
- main_app
platform: linux/amd64
ports:
- '11211:11211'
scraper:
depends_on:
- database
- splash-server
env_file: .env
environment:
EXAMPLE: woof
WORKERS: 1
build:
context: .
dockerfile: server/Dockerfile
target: scraper-dev
networks:
- scraper
platform: linux/amd64
ports:
- "3001:3001"
volumes:
- ./server:/opt/nlp-stock-sa/server
# - ~/.aws:/home/nlpstocksaapp/.aws:ro
splash-server:
# Currently open issue related to this not working on M1 Macs
# https://github.com/docker/for-mac/issues/7220
image: scrapinghub/splash:latest
networks:
- scraper
platform: linux/amd64
ports:
- "8050:8050"
volumes:
- splash:/opt/nlp-stock-sa/scraper/splash
networks:
main_app:
driver: bridge
scraper:
driver: bridge
volumes:
db_volume:
splash:
# frontend-test:
# env_file: .env
# environment:
# ENV: test
# build:
# context: .
# dockerfile: app/Dockerfile
# target: frontend-test