Add HEALTHCHECK support, close #2

This commit is contained in:
Peter Dave Hello 2018-02-24 03:29:31 +08:00
parent 80db924d8d
commit 3b1727ab3d

View file

@ -4,11 +4,14 @@ MAINTAINER Peter Dave Hello <hsu@peterdavehello.org>
RUN echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && \
apk -U upgrade && \
apk -v add tor@edge && \
apk -v add tor@edge curl && \
rm -rf /var/cache/apk/*
RUN tor --version
ADD torrc /etc/tor/
HEALTHCHECK --timeout=10s --start-period=60s \
CMD curl --fail --socks5-hostname localhost:9150 -I -L 'https://cdnjs.com/' || exit 1
EXPOSE 9150
CMD /usr/bin/tor -f /etc/tor/torrc