feat: making the script insta fail if off

This commit is contained in:
wander 2026-02-06 20:38:19 -05:00
parent dd338125f0
commit aa6ce865a7
3 changed files with 78 additions and 66 deletions

View file

@ -1,47 +1,22 @@
FROM python:3.10-alpine
FROM python:3.11-alpine
ENV HOME=/var/lib/tor
ENV VANGUARDS_CONFIG=/etc/tor/vanguards.conf
# Install runtime dependencies
# tor and torsocks are available in Alpine edge/community repos
# Install Tor and build dependencies
# We keep python base image for potential Vanguards support later (which is python based),
# but for now we are simplifying the build.
RUN apk add --no-cache \
tor \
torsocks \
libevent \
openssl \
ca-certificates \
libffi \
curl \
build-base \
libffi-dev \
openssl-dev \
grep \
&& mkdir -p /var/lib/tor/hidden_service/ \
&& chown -R tor:root /var/lib/tor
WORKDIR /usr/local/src/onions
# Install Python dependencies
COPY requirements.txt .
RUN apk add --no-cache --virtual .build-deps \
build-base \
openssl-dev \
libffi-dev \
cargo \
&& pip install --no-cache-dir -r requirements.txt \
&& apk del .build-deps
# Install application
COPY setup.py .
COPY onions onions/
RUN pip install --no-cache-dir .
# Copy configuration and entrypoint
COPY assets/entrypoint-config.yml /entrypoint-config.yml
COPY assets/torrc /var/local/tor/torrc.tpl
COPY assets/vanguards.conf.tpl /var/local/tor/vanguards.conf.tpl
# Copy our Magic Script
COPY assets/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
VOLUME ["/var/lib/tor/hidden_service/"]
# Set the Magic Script as the entrypoint
ENTRYPOINT ["/entrypoint.sh"]
CMD ["tor"]