-
Notifications
You must be signed in to change notification settings - Fork 72.8k
FIX issue #4852 Dockerfile does not build with 0.12.3 #5716
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
Conversation
| PORT: 1337 | ||
| TIME_FORMAT: "24" | ||
| DISPLAY_UNITS: "mmol" | ||
| WAIT_HOSTS: "database:27017" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for me. I had to use something like
command: sh -c "sleep 5; node server.js"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pls post the std out output in the comments? It works fine on my machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I am not using your branch, but my docker compose file is very similar. I've also added WAIT_HOSTS. I think it is a timing problem. As you can see in the startup sequence the nightscout-app is not waiting long enough. Although nightscout-app makes afterward a successful connection, Nightscout doesn't work. I didn't have this problem with the same docker-compose.yml file before upgrading to 14.0.7.
nightscout-db | 2020-11-27T16:01:00.060+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=a6370c7791ae
...
nightscout-app | Error connecting to MongoDB: {"name":"MongoNetworkError"} - retrying in 3 sec
nightscout-app | ERROR CONNECTING TO MONGO Error: MongoDB connection failed! Double check the MONGODB_URI setting in Heroku.
nightscout-app | at MongoClient.connect.then.catch.err (/opt/app/lib/storage/mongo-storage.js:75:30)
nightscout-app | at process._tickCallback (internal/process/next_tick.js:68:7)
nightscout-app | Mongo Storage system ready
...
nightscout-db | 2020-11-27T16:01:01.177+0000 I NETWORK [initandlisten] waiting for connections on port 27017
...
nightscout-app | Successfully established a connected to MongoDB
nightscout-app | Mongo user role seems ok: [ { role: 'root', db: 'admin' } ]
nightscout-app | Mongo Storage system ready
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WAIT_HOSTS is not a built in functionality, I had to add support for it in the Dockerfile
## Add the wait script to the image
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /wait
RUN chmod +x /wait
docker-compose.yml
Outdated
|
|
||
| services: | ||
| nightscout: | ||
| image: "skalahonza/nightscout" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be obsolete and should be discarded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Discarded.
|
Apologies for the long latency - DEV now has working Docker setup, coupled with Github Actions Docker build. More improvements to land soon. https://hub.docker.com/r/nightscout/cgm-remote-monitor/tags?page=1&ordering=last_updated |
|
@sulkaharo No worries for the long latency. I have running a similar setup like in this PR for several months. I think it would be important also to add a docker compose solution for the people. If you want to I could review and test @skalahonza in more detail. |
|
@pazaan is working on the compose - we were discussing supporting both compositions that only contain the Nightscout Node component but also one that has Mongo as well, which would be a fully self contained image. |
|
@pazaan Is there some progress for docker compose? |
|
See #6903 |
I edited the Dockerfile so it can be acutally built. I also added a docker-compose file so you can run nightscout and mongodb locally using docker-compose up.
This is also related to
Because it is now possible to run Docker images pushed to DockerHub in the Azure AppService.
Building official Docker image
It is now possible to let DockerHub build image for you. All you need to do is to link it with the official repository.
https://docs.docker.com/docker-hub/builds/
You can build images with tag dev from dev branch and official latest/production images from master branch with ease.