diff --git a/README.md b/README.md
index 3589354..9632302 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,7 @@ todo-next is a regular TO-DO notes listing app aimed for testing using NextJS an
- [Seed MongoDB with Default Data](#seed-mongodb-with-default-data)
- [Docker Commands](#docker-commands)
- [Deployment With GitHub Actions](#deployment-with-gitHub-actions)
+- [Other Notes](#other-notes)
## Installation
@@ -174,6 +175,40 @@ This project deploys the production live demo to GitHub Pages (front end) and Ve
| --- | --- |
| DOCKERHUB_USERNAME | (Optional) Docker Hub username. Required to enable pushing the development image to Docker Hub. |
+## Other Notes
+
+
+
+Debugging the server app running inside a container with VSCode
+
+
+1. Add the following configuration in the VSCode `launch.json` file's `"configuration": []` array.
+ ```
+ {
+ "type": "node",
+ "request": "attach",
+ "name": "Docker: Attach to Node",
+ "port": 9229,
+ "address": "localhost",
+ "localRoot": "${workspaceFolder}//server",
+ "remoteRoot": "/opt/server",
+ "restart": true,
+ "sourceMaps": true,
+ "skipFiles": ["/**"]
+ }
+ ```
+
+2. Run the server container.
+
+3. To enable debugging the server running inside the container from **step # 2** with VSCode:
+ - Press Ctrl + Shift + D
+ - Select `"Docker: Attach to Node"`
+ - Press the **Play** button (green arrow icon)
+
+
+
+
+
@weaponsforge
20220820
20241004
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 6b7de1f..6c2e4ff 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -33,9 +33,11 @@ services:
networks:
- todo-next-dev
volumes:
- - ./server/src:/opt/server/src
+ - ./server:/opt/server
+ - /opt/server/node_modules
ports:
- "3001:3001"
+ - "9229:9229"
depends_on:
- mongo
links:
diff --git a/server/.dockerignore b/server/.dockerignore
index b37f04a..4e63e7f 100644
--- a/server/.dockerignore
+++ b/server/.dockerignore
@@ -6,3 +6,6 @@ Dockerfile
.dockerignore
.env
.vercel
+*.zip
+*.rar
+*.txt
diff --git a/server/.gitignore b/server/.gitignore
index fdf1d5d..8468b2f 100644
--- a/server/.gitignore
+++ b/server/.gitignore
@@ -1,5 +1,6 @@
node_modules/
.env
*.zip
-
-.vercel
+*.rar
+*.txt
+.vercel
diff --git a/server/package.json b/server/package.json
index ff1bc67..8c554fe 100644
--- a/server/package.json
+++ b/server/package.json
@@ -6,7 +6,7 @@
"scripts": {
"start": "node api/index.js",
"start:vercel": "node api/index.js",
- "dev": "nodemon watch src/index.js",
+ "dev": "nodemon --inspect=0.0.0.0:9229 src/index.js",
"lint": "eslint src",
"lint:fix": "eslint src --fix"
},