I'm learning how to use docker, this is on windows. I have a simple docker compose:
version: "3.8"
services:
auth:
container_name: auth
stdin_open: true
restart: always
build:
context: ./auth
command: npm run dev
ports:
- "3003:3003"
volumes:
- ./auth:/usr/src/app/auth
- /usr/src/app/auth/node_modules
where my run dev inside package.json
auth app is:
"dev": "nodemon -L src/index.ts",
upon running and looking at logs:
// inside a route I have a console.log
console.log("GET /signup");
auth | > auth@1.0.0 dev
auth | > nodemon -L src/index.ts
auth |
auth | [nodemon] 2.0.16
auth | [nodemon] to restart at any time, enter `rs`
auth | [nodemon] watching path(s): *.*
auth | [nodemon] watching extensions: ts,json
auth | [nodemon] starting `ts-node src/index.ts`
auth | [Auth] Connected to database
auth | [Auth] Server running on port 3003
auth | GET /signup
I test the route and it works. The odd part is changes I make are reset by nodemon but aren't actually propagated...
changes to the log:
console.log("GET but why /signup");
the container log with route test:
auth | [nodemon] restarting due to changes...
auth | [nodemon] starting `ts-node src/index.ts`
auth | [Auth] Connected to database
auth | [Auth] Server running on port 3003
auth | GET /signup
As you can see the console never changed, in fact, I even delete the whole route for sanity, it reset and the route still works even though the code was removed.
What am I missing here?