tor: container create helper and relay docs.

Document ORPort layout and host vs container tor coexistence.
This commit is contained in:
Hernâni Marques 2026-07-17 00:30:13 +02:00
parent a42b43b410
commit 85d4e05ef0
4 changed files with 63 additions and 4 deletions

View file

@ -1,10 +1,18 @@
# koopa-tor-relay — Tor non-exit relay
# Process is NOT root: debian-tor remapped to uid/gid 1000 for rootless
# podman + host volumes (~/koopa-tor-relay/{data,log} owned by hernani).
# Recreate container with: --user 1000:1000 --userns=keep-id (see README).
FROM docker.io/library/debian:bookworm-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends tor nyx ca-certificates tor-geoipdb \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /var/lib/tor /var/log/tor \
&& chown -R debian-tor:debian-tor /var/lib/tor /var/log/tor
&& groupmod --gid 1000 debian-tor \
&& usermod --uid 1000 --gid 1000 debian-tor \
&& chown -R debian-tor:debian-tor /var/lib/tor /var/log/tor \
&& chmod 700 /var/lib/tor
EXPOSE 8080 9051
USER debian-tor:debian-tor
ENTRYPOINT ["/usr/bin/tor"]
CMD ["-f", "/etc/tor/torrc", "--runasdaemon", "0"]