Skip to content

Commit

Permalink
Add volume to point to config file and add healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Nys committed Oct 7, 2018
1 parent 8d5363c commit d9d3860
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
FROM node:5-onbuild

VOLUME /etc/statsd/
COPY exampleConfig.js /etc/statsd/config.js
RUN \
cp -v exampleConfig.js config.js && \
sed -i 's/graphite.example.com/graphite/' config.js
sed -i 's/graphite.example.com/graphite/' /etc/statsd/config.js

EXPOSE 8125/udp
EXPOSE 8125/UDP
EXPOSE 8126
RUN apt-get -y update && \
apt-get -y install --no-install-recommends \
netcat=1.10-41 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENTRYPOINT [ "node", "stats.js", "config.js" ]
CMD [ "node", "stats.js", "/etc/statsd/config.js" ]
HEALTHCHECK --interval=30s --timeout=2s --retries=3 CMD nc -vv -z -u 127.0.0.1 8125

0 comments on commit d9d3860

Please sign in to comment.