Skip to content

Commit ac3aed8

Browse files
committedApr 23, 2020
docker nodejs debugging
1 parent a6ea337 commit ac3aed8

File tree

7 files changed

+38
-411
lines changed

7 files changed

+38
-411
lines changed
 

‎.vscode/launch.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@
4444
"host": "127.0.0.1"
4545
},
4646
{
47-
4847
"name": "Docker: Attach to Node",
4948
"type": "node",
5049
"request": "attach",
51-
"remoteRoot": "/work/",
50+
"remoteRoot": "/work/src/",
5251
"port": 9229,
5352
"address": "localhost",
5453
"localRoot": "${workspaceFolder}/nodejs/src/",

‎docker-compose.yaml

+15-14
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,34 @@ services:
2525
- 2345:2345
2626
security_opt:
2727
- "seccomp:unconfined"
28-
nodejs: #docker run -it -v ${PWD}:/work -w /work -p 5002:5000 aimvector/nodejs:1.0.0 /bin/sh
29-
container_name: nodejs
30-
image: aimvector/nodejs:1.0.0
28+
python: #docker run -it -v ${PWD}:/work -w /work -p 5003:5000 aimvector/python:1.0.0 /bin/sh
29+
container_name: python
30+
image: aimvector/python:1.0.0
3131
build:
32-
context: ./nodejs
32+
context: ./python
3333
target: debug
3434
#working_dir: /work #comment out for build.target:prod
3535
#entrypoint: /bin/sh #comment out for build.target:prod
3636
#stdin_open: true #comment out for build.target:prod
3737
#tty: true #comment out for build.target:prod
3838
volumes:
39-
- ./nodejs/src/:/work
39+
- ./python/src/:/work
4040
ports:
41-
- 5002:5000
42-
- 9229:9229 #debug port
43-
python: #docker run -it -v ${PWD}:/work -w /work -p 5003:5000 aimvector/python:1.0.0 /bin/sh
44-
container_name: python
45-
image: aimvector/python:1.0.0
41+
- 5003:5000
42+
- 5678:5678
43+
nodejs: #docker run -it -v ${PWD}:/work -w /work -p 5002:5000 aimvector/nodejs:1.0.0 /bin/sh
44+
container_name: nodejs
45+
image: aimvector/nodejs:1.0.0
4646
build:
47-
context: ./python
47+
context: ./nodejs
4848
target: debug
4949
#working_dir: /work #comment out for build.target:prod
5050
#entrypoint: /bin/sh #comment out for build.target:prod
5151
#stdin_open: true #comment out for build.target:prod
5252
#tty: true #comment out for build.target:prod
5353
volumes:
54-
- ./python/src/:/work
54+
- ./nodejs/src/:/work/src/
5555
ports:
56-
- 5003:5000
57-
- 5678:5678
56+
- 5002:5000
57+
- 9229:9229 #debug port
58+

‎nodejs/deployment/service copy.yaml

-15
This file was deleted.

‎nodejs/deployment/service.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: example-service
5+
labels:
6+
app: example-app
7+
spec:
8+
type: LoadBalancer
9+
selector:
10+
app: example-app
11+
ports:
12+
- protocol: TCP
13+
name: http
14+
port: 80
15+
targetPort: 5000

‎nodejs/dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ COPY ./src/package.json /work/package.json
66
RUN npm install
77
RUN npm install -g nodemon
88

9-
COPY ./src/ /work/
9+
COPY ./src/ /work/src/
1010

11-
CMD nodemon --inspect=0.0.0.0 server.js
11+
ENTRYPOINT [ "nodemon","--inspect=0.0.0.0","./src/server.js" ]
1212

1313
FROM node:12.4.0-alpine as prod
1414

0 commit comments

Comments
 (0)