File tree 4 files changed +58
-0
lines changed
4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -31,3 +31,29 @@ services:
31
31
environment :
32
32
- POSTGRES_USER=postgres
33
33
- POSTGRES_PASSWORD=postgres
34
+
35
+ client :
36
+ container_name : client
37
+ build :
38
+ context : ./services/client
39
+ dockerfile : Dockerfile-dev
40
+ volumes :
41
+ - ' ./services/client:/usr/src/app'
42
+ - ' /usr/src/app/node_modules'
43
+ ports :
44
+ - ' 3007:3000'
45
+ environment :
46
+ - NODE_ENV=development
47
+ - REACT_APP_USERS_SERVICE_URL=${REACT_APP_USERS_SERVICE_URL}
48
+ depends_on :
49
+ - users
50
+
51
+ nginx :
52
+ container_name : nginx
53
+ build : ./services/nginx
54
+ restart : always
55
+ ports :
56
+ - 80:80
57
+ depends_on :
58
+ - users
59
+ - client
Original file line number Diff line number Diff line change
1
+ node_modules
2
+ coverage
3
+ build
4
+ env
5
+ htmlcov
6
+ .dockerignore
7
+ Dockerfile-dev
8
+ Dockerfile-prod
Original file line number Diff line number Diff line change
1
+ FROM node:9
2
+
3
+ RUN mkdir /usr/src/app
4
+ WORKDIR /usr/src/app
5
+
6
+ ENV PATH /usr/src/app/node_modules/.bin:$PATH
7
+
8
+ COPY package.json /usr/src/app/package.json
9
+ RUN npm install
10
+ RUN npm install
[email protected] -g --silent
11
+
12
+ CMD ["npm", "start"]
Original file line number Diff line number Diff line change @@ -3,6 +3,18 @@ server {
3
3
listen 80;
4
4
5
5
location / {
6
+ proxy_pass http://client:3000;
7
+ proxy_redirect default;
8
+ proxy_http_version 1.1;
9
+ proxy_set_header Upgrade $http_upgrade;
10
+ proxy_set_header Connection "upgrade";
11
+ proxy_set_header Host $host;
12
+ proxy_set_header X-Real-IP $remote_addr;
13
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
14
+ proxy_set_header X-Forwarded-Host $server_name;
15
+ }
16
+
17
+ location /users {
6
18
proxy_pass http://users:5000;
7
19
proxy_redirect default;
8
20
proxy_set_header Host $host;
You can’t perform that action at this time.
0 commit comments