Last active
June 6, 2018 10:53
-
-
Save supertassu/e701e0e51b78014b7e7f1b3eb251bfd6 to your computer and use it in GitHub Desktop.
debugging docker containers via vs code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"preLaunchTask": "restart docker", | |
"type": "node", | |
"request": "attach", | |
"name": "debug it", | |
"port": 5858 | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "restart docker", | |
"type": "shell", | |
"command": "docker kill [SOMETHING]_backend_1 ; source .env && docker-compose up --build -d backend" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/backend/package.json b/backend/package.json | |
index 5534f0a..5ea1ecb 100644 | |
--- a/backend/package.json | |
+++ b/backend/package.json | |
@@ -17,7 +17,7 @@ | |
"copy:config": "cp src/config.sample.js src/config.js", | |
- "dev": "./node_modules/.bin/nodemon server.js", | |
+ "dev": "./node_modules/.bin/nodemon --inspect=0.0.0.0:5858 server.js", | |
"start": "node server.js", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/docker-compose.yml b/docker-compose.yml | |
index ede6528..83246be 100644 | |
--- a/docker-compose.yml | |
+++ b/docker-compose.yml | |
@@ -26,6 +26,7 @@ services: | |
- ./uploads:/uploads | |
ports: | |
- 9000:9000 | |
+ - 5858:5858 | |
depends_on: | |
- db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/backend/Dockerfile b/backend/Dockerfile | |
index 66d9dbf..a739275 100644 | |
--- a/backend/Dockerfile | |
+++ b/backend/Dockerfile | |
@@ -12,5 +12,6 @@ RUN npm install | |
COPY . /usr/src/app | |
EXPOSE 9000 | |
+EXPOSE 5858 | |
CMD [ "npm", "start" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment