Last active
August 1, 2023 05:15
-
-
Save yaroslavTsebro/2922c4ec9542053e8c220892b46d8bb3 to your computer and use it in GitHub Desktop.
ts-node nodemon docker debug-mode
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: | |
| backend: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile.dev | |
| ports: | |
| - "3000:3000" | |
| - "9229:9229" | |
| environment: | |
| NODE_ENV: "production" | |
| DB_USER: user | |
| DB_PASSWORD: password | |
| DB_HOST: "mongodb" | |
| DB_PORT: 27017 | |
| DB_NAME: mydb1 | |
| LOGS_PATH: "./data/logs/pino-logger.log" | |
| volumes: | |
| - ./src:/usr/app/src |
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:18 | |
| WORKDIR /usr/app | |
| RUN npm install nodemon bcrypt -g | |
| COPY package*.json ./ | |
| RUN npm install --force | |
| COPY . ./ | |
| EXPOSE 3000 | |
| CMD [ "npm", "run", "start-dev" ] |
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": "node", | |
| "request": "attach", | |
| "name": "Node: Nodemon", | |
| "restart": true, | |
| "sourceMaps": true, | |
| "protocol": "inspector", | |
| "address": "127.0.0.1", | |
| "port": 9229, | |
| "localRoot": "${workspaceRoot}", | |
| "remoteRoot": "/usr/app", | |
| }, | |
| ] | |
| } |
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
| { | |
| "watch": ["src"], | |
| "ext": ".ts,.js", | |
| "ignore": [], | |
| "exec": "ts-node --files ./src/app.ts --polling" | |
| } |
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
| src | |
| ... | |
| ... | |
| app.ts | |
| server.ts | |
| Dockerfile.dev | |
| docker-compose.dev.yaml |
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
| "scripts": { | |
| "start-dev": "nodemon -L --inspect-brk=0.0.0.0:9229 --signal SIGINT --nolazy src/app.ts", | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment