| ADD alpine-minirootfs-3.23.5-aarch64.tar.gz / # buildkit |
| CMD ["/bin/sh"] |
| ARG SOURCE_DATE_EPOCH=1784223354 |
| ENV HOME=/var/lib/tor |
| ENV PYTHONUNBUFFERED=1 |
| ENV PYTHONDONTWRITEBYTECODE=1 |
| ENV PIP_DISABLE_PIP_VERSION_CHECK=1 |
| RUN |1 SOURCE_DATE_EPOCH=1784223354 /bin/sh -c apk add --no-cache tor=0.4.9.11-r0 python3=3.12.13-r0 su-exec=0.3-r0 && apk add --no-cache --virtual .build-deps=0 py3-pip=25.1.1-r1 && rm -f /var/log/apk.log && sed -i "s#^\([^:]*:[^:]*\):[0-9]*:#\1:$(( SOURCE_DATE_EPOCH / 86400 )):#" /etc/shadow # buildkit |
| COPY requirements.txt /tmp/requirements.txt # buildkit |
| RUN |1 SOURCE_DATE_EPOCH=1784223354 /bin/sh -c python3 -m venv /opt/vanguards-venv && /opt/vanguards-venv/bin/pip install --no-cache-dir --no-deps --require-hashes -r /tmp/requirements.txt && sed -i 's/from configparser import SafeConfigParser/from configparser import RawConfigParser as SafeConfigParser/' /opt/vanguards-venv/lib/python3.12/site-packages/vanguards/config.py && grep -q 'from configparser import RawConfigParser as SafeConfigParser' /opt/vanguards-venv/lib/python3.12/site-packages/vanguards/config.py && /opt/vanguards-venv/bin/pip uninstall -y pip setuptools wheel 2>/dev/null || true && find /opt/vanguards-venv -type d -name 'test' -exec rm -rf {} + 2>/dev/null || true && find /opt/vanguards-venv -type d -name 'tests' -exec rm -rf {} + 2>/dev/null || true && find /opt/vanguards-venv -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true && find /opt/vanguards-venv -name '*.pyc' -delete && find /opt/vanguards-venv -name '*.pyo' -delete && rm /tmp/requirements.txt && apk del .build-deps && rm -f /var/log/apk.log # buildkit |
| RUN |1 SOURCE_DATE_EPOCH=1784223354 /bin/sh -c mkdir -p ${HOME}/.tor /etc/tor && chown -R tor:tor ${HOME} && chmod 700 ${HOME} # buildkit |
| COPY entrypoint.py /usr/local/bin/entrypoint.py # buildkit |
| COPY healthcheck.py /usr/local/bin/healthcheck.py # buildkit |
| COPY tests/test_torrc.py /usr/local/bin/tests/test_torrc.py # buildkit |
| RUN |1 SOURCE_DATE_EPOCH=1784223354 /bin/sh -c chmod 755 /usr/local/bin/entrypoint.py /usr/local/bin/healthcheck.py # buildkit |
| VOLUME [/var/lib/tor/hidden_service/] |
| HEALTHCHECK {Test:[CMD-SHELL su-exec tor python3 /usr/local/bin/healthcheck.py || exit 1] Interval:1m0s Timeout:10s StartPeriod:2m0s StartInterval:0s Retries:3} |
| ENTRYPOINT ["python3" "/usr/local/bin/entrypoint.py"] |