Dockerfile: Add torsocks binary.

This has two purposes:
1) The 'torify' wrapper is already included, and it needs torsocks.
2) Use torsocks for health checking your onion service like this:

healthcheck:
  test: ["CMD-SHELL", "torsocks nc -z <onion address> <port> || exit 1"]
  interval: 2m
This commit is contained in:
Andreas Schildbach 2020-11-27 17:32:35 +01:00 committed by Christophe Mehay
parent b451f25be9
commit 83d59f7ff0
4 changed files with 18 additions and 2 deletions

View file

@ -1,5 +1,6 @@
FROM python:3.8-alpine
ARG tor_version
ARG torsocks_version
ENV HOME /var/lib/tor
ENV POETRY_VIRTUALENVS_CREATE=false
@ -21,6 +22,17 @@ RUN apk add --no-cache git bind-tools libevent-dev openssl-dev gnupg gcc mak
apk del git libevent-dev openssl-dev gnupg make automake autoconf musl-dev coreutils libffi-dev && \
apk add --no-cache libevent openssl
RUN apk add --no-cache git gcc make automake autoconf musl-dev libtool && \
git clone https://git.torproject.org/torsocks.git /usr/local/src/torsocks && \
cd /usr/local/src/torsocks && \
git checkout $torsocks_version && \
./autogen.sh && \
./configure && \
make && make install && \
cd .. && \
rm -rf torsocks && \
apk del git gcc make automake autoconf musl-dev libtool
RUN mkdir -p /etc/tor/
COPY pyproject.toml /usr/local/src/onions/