-
-
Notifications
You must be signed in to change notification settings - Fork 44
Docker MQTT deployment #48
base: master
Are you sure you want to change the base?
Conversation
Modified dockerfile for auto deployment Modified mqtt_daemon.py to always use contract_id in topic
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.
Thanks for your PR. I put some comments, I just need to understand some of your changes.
Globally, I don't understand:
- Why you changed the dockerfile
- Why you changed the mqtt push data
- Why using docker-compose, when there is only one container ... a single docker command can do the trick
@@ -1,6 +1,9 @@ | |||
#!/bin/sh | |||
set -e | |||
|
|||
# Copy config file if does not exists | |||
rsync -a -v --ignore-existing config.yaml.sample config/config.yaml |
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.
Why are you doing this ?
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.
For the persistence of the mqtt config file. You want to create the file if it's missing in the config without overwriting it.
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.
I would not do that, I think it better to crash if the file doesn't exists instead of copying a bad config file. What do you think ?
|
||
COPY requirements.txt ./ | ||
RUN pip install -r requirements.txt --force-reinstall --no-cache-dir | ||
WORKDIR /usr/pyhydroquebec |
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.
Why do you change the working dir ?
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.
I put everything in the same root folder instead of having one root folder for the code and one root folder for the config.
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.
OK, but /usr/SOMETHING
it's a weird folder. I would use something like /usr/local/pyhydroquebec
.
In fact, we are copyng application's sources, that's why I put /usr/src/app
, but I should put /usr/local/src/pyhydroquebec
.
What do you think using /usr/local/src/pyhydroquebec
?
Thanks for the review, Why you changed the dockerfile Why you changed the mqtt push data Why using docker-compose, when there is only one container ... a single docker command can do the trick |
Thanks for your answers !!
I'm sorry but I still don't understand those changes in the Dockerfile. Today, I'm using the current master docker image with MQTT without any issue. What are the issues that you're a trying to solve with theses change ?
Thanks for this one !
OK, Thanks for this one too ! |
BTW, I will handle the merge conflict (I created it ...) |
Modified your project to deploy with docker-compose and fix the configuration implementation (mqtt).