Skip to content

Commit df96dfd

Browse files
committed
Add Node debugging
and simplify Compose file
1 parent 64839f7 commit df96dfd

File tree

3 files changed

+31
-38
lines changed

3 files changed

+31
-38
lines changed

docker-compose.yml

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,27 @@ version: "2"
22

33
services:
44
voting-app:
5-
build: ./voting-app/.
5+
build: ./voting-app
66
volumes:
77
- ./voting-app:/app
88
ports:
99
- "5000:80"
10-
links:
11-
- redis
12-
networks:
13-
- front-tier
14-
- back-tier
15-
16-
result-app:
17-
build: ./result-app/.
18-
volumes:
19-
- ./result-app:/app
20-
ports:
21-
- "5001:80"
22-
links:
23-
- db
24-
networks:
25-
- front-tier
26-
- back-tier
27-
28-
worker:
29-
build: ./worker
30-
links:
31-
- db
32-
- redis
33-
networks:
34-
- back-tier
3510

3611
redis:
3712
image: redis:alpine
3813
ports: ["6379"]
39-
networks:
40-
- back-tier
14+
15+
worker:
16+
build: ./worker
4117

4218
db:
4319
image: postgres:9.4
44-
volumes:
45-
- "db-data:/var/lib/postgresql/data"
46-
networks:
47-
- back-tier
4820

49-
volumes:
50-
db-data:
51-
52-
networks:
53-
front-tier:
54-
back-tier:
21+
result-app:
22+
build: ./result-app
23+
command: nodemon --debug server.js
24+
volumes:
25+
- ./result-app:/app
26+
ports:
27+
- "5001:80"
28+
- "5858:5858"

result-app/.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach",
6+
"type": "node",
7+
"request": "attach",
8+
"port": 5858,
9+
"address": "localhost",
10+
"restart": true,
11+
"sourceMaps": false,
12+
"outDir": null,
13+
"localRoot": "${workspaceRoot}",
14+
"remoteRoot": "/app",
15+
"timeout": 10000
16+
}
17+
]
18+
}

result-app/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM node:5.11.0-slim
22

33
WORKDIR /app
44

5+
RUN npm install -g nodemon
56
ADD package.json /app/package.json
67
RUN npm config set registry http://registry.npmjs.org
78
RUN npm install && npm ls

0 commit comments

Comments
 (0)