Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support server-side debugging when running local in docker #450

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@
],
"port": 9229,
"outputCapture": "std"
},
{
"type": "node",
"request": "attach",
"name": "Docker: Attach to base debugger",
"address": "0.0.0.0",
"remoteRoot": "/app",
"port": 9229
},
{
"type": "node",
"request": "attach",
"name": "Docker: Attach to nextjs router server",
"address": "0.0.0.0",
"remoteRoot": "/app",
"port": 9230
},
{
"type": "node",
"request": "attach",
"name": "Docker: Attach to nextjs pages server",
"address": "0.0.0.0",
"remoteRoot": "/app",
"port": 9231
},
{
"type": "node",
"request": "attach",
"name": "Docker: Attach to nextjs app server",
"address": "0.0.0.0",
"remoteRoot": "/app",
"port": 9232
}
]
}
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ WORKDIR /app

EXPOSE 3000

EXPOSE 9229

EXPOSE 9230

EXPOSE 9231

EXPOSE 9232

COPY package.json package-lock.json ./
RUN npm ci --legacy-peer-deps --loglevel verbose
CMD ["sh","-c","npm install --loglevel verbose --legacy-peer-deps && npx prisma migrate dev && npm run dev"]
CMD ["sh","-c","npm install --loglevel verbose --legacy-peer-deps && npx prisma migrate dev && npm run dev"]
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ services:
- "3000"
ports:
- "3000:3000"
- "9229:9229"
- "9230:9230"
- "9231:9231"
- "9232:9232"
volumes:
- ./:/app
labels:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "NODE_OPTIONS='--trace-warnings' next dev",
"dev": "NODE_OPTIONS='--trace-warnings --inspect=0.0.0.0:9229' next dev",
"build": "next build",
"migrate": "prisma migrate deploy",
"start": "NODE_OPTIONS='--trace-warnings --max-old-space-size=4096 --max-semi-space-size=128' next start -p $PORT --keepAliveTimeout 120000",
Expand Down
Loading