Last active
February 1, 2022 20:48
-
-
Save lammichael/223a252566035e28ad6cc9ae57807607 to your computer and use it in GitHub Desktop.
Debugging a parcel app, running in Docker, in VS Code
This file contains hidden or 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: "3.7" | |
services: | |
serve: | |
build: | |
context: . | |
volumes: | |
- .:/app/ | |
ports: | |
- 1234:1234 | |
- 1235:1235 | |
environment: | |
- CHOKIDAR_USEPOLLING=1 |
This file contains hidden or 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
FROM node:10.15.3-alpine | |
WORKDIR /app | |
# In package.json I define the serve script as | |
# "parcel src/index.html --hmr-port 1235" | |
ENTRYPOINT ["npm", "run", "serve"] |
This file contains hidden or 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": [ | |
{ | |
"type": "chrome", | |
"request": "launch", | |
"name": "Launch Chrome", | |
"url": "http://localhost:1234", | |
"webRoot": "${workspaceFolder}/src", | |
"preLaunchTask": "Docker Compose: up", | |
"postDebugTask": "Docker Compose: down", | |
"skipFiles": [ | |
"node_modules" | |
], | |
} | |
] | |
} |
This file contains hidden or 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": "Docker Compose: up", | |
"command": "docker-compose", | |
"args": [ | |
"up", | |
"serve" | |
], | |
"isBackground": true, | |
"problemMatcher": { | |
"fileLocation": "absolute", | |
"owner": "docker-compose", | |
"background": { | |
"activeOnStart": true, | |
"beginsPattern": ".*", | |
"endsPattern": "Built" | |
}, | |
"pattern": { | |
"regexp": "", | |
} | |
} | |
}, | |
{ | |
"label": "Docker Compose: down", | |
"command": "docker-compose", | |
"args": [ | |
"down", | |
"--timeout", | |
"1" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@lammichael This looks great, thanks for sharing!