Changes not being triggered on Docker
See original GitHub issueI have this simple setup for testing purposes:
Dockerfile
:
FROM node:11.2.0-alpine
WORKDIR /usr/src/app
RUN yarn
docker-compose.yml
:
version: "3.7"
services:
server:
build: .
command: yarn start
ports:
- 4000:4000
volumes:
- .:/usr/src/app
index.js
:
const express = require("express");
const app = express();
app.get("/", (req, res) => {
res.send("hello world");
});
app.listen(4000, () => console.log("The server is listening on port 4000"));
In my package.json
I have a script that is:
"scripts": {
"start": "onchange -i -k **/*.js -- node index.js"
}
It does work locally in my computer, however when running in a Docker container it doesn’t detect the changes and nothing happens.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Volume changes not being detected by docker programs
When i make changes in host directory, they are refelcted in Docker directory but apps like nodemon or react-hot-reloader do not detect them ......
Read more >How to Fix and Debug Docker Containers Like a Superhero
Container errors are tricky to diagnose, but some investigative magic works wonders. Read along to learn how to debug Docker containers.
Read more >How to Enable Live-reload on Docker-based Applications with ...
In this post you'll learn how to configure a development environment with live-reload enabled. This will allow you to convert a legacy ...
Read more >The worst so-called “best practice” for Docker - Python⇒Speed
To be clear: RUN commands happen during image build, not during container startup. The documentation there is saying “build your images ...
Read more >`.gitlab-ci.yml` keyword reference - GitLab Docs
15.8 (not yet released) ... Custom Docker images · External database ... GitLab 15 changes · GitLab 14 changes · GitLab 13 changes....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@blakeembrey Yes, it’s really weird, but it’s like opening a new process and that is why it’s saying that the port is already in use. I don’t have a repo with the configuration I sent, I can do that later (it’s 4AM for me right now), or you can try in the mean time. (if possible)
@zefexdeveloper You’re saying it isn’t closing the previous process before starting a new process? That seems odd since it listens for
exit
on the process before spawning another, but I’ll have to give it a go to replicate. Do you have a simple repo with the above configuration to get started there? I can do it myself too, but it may take a bit longer to get around to is all 😄