Skip to content

Commit

Permalink
Support external MQTT servers
Browse files Browse the repository at this point in the history
  • Loading branch information
pschmitt committed Dec 21, 2017
1 parent ee6ff52 commit 7dd94b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUN go build -v
RUN echo "\ninclude_dir /usr/local/work/src/github.com/schollz/find/mosquitto" >> /etc/mosquitto/mosquitto.conf

# Setup supervisor
RUN apt-get update
RUN apt-get update
RUN apt-get install -y supervisor

# Add supervisor
Expand All @@ -54,6 +54,9 @@ ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]

# Default MQTT connection settings
ENV MQTT_SERVER=localhost:1883 MQTT_USERNAME=admin MQTT_PASSWORD=123

# Startup
CMD ["/usr/bin/supervisord"]

2 changes: 1 addition & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ stderr_logfile_maxbytes=0

[program:findserver]
directory=/usr/local/work/src/github.com/schollz/find
command=/usr/local/work/src/github.com/schollz/find/find -rf 5009 -mqtt localhost:1883 -mqttadmin admin -mqttadminpass 123 -mosquitto `pgrep mosquitto` -data /data
command=/usr/local/work/src/github.com/schollz/find/find -rf 5009 -mqtt %(ENV_MQTT_SERVER)s -mqttadmin %(ENV_MQTT_USERNAME)s -mqttadminpass %(ENV_MQTT_PASSWORD)s -mosquitto `pgrep mosquitto` -data /data
priority=999
stdout_logfile=/usr/local/work/src/github.com/schollz/find/log.out
stdout_logfile_maxbytes=0
Expand Down

0 comments on commit 7dd94b7

Please sign in to comment.