Dockerfile 386 B

12345678910111213141516
  1. FROM alpine:3.8
  2. RUN apk add --no-cache tor
  3. RUN adduser -S onion
  4. RUN mkdir -m u=rwx,g=,o= /onion-service && chown onion /onion-service
  5. VOLUME /onion-service
  6. COPY --chown=onion:nobody torrc.template /
  7. USER onion
  8. ENV VIRTUAL_PORT 80
  9. ENV TARGET 127.0.0.1:8080
  10. CMD sed -e "s#{virtual_port}#$VIRTUAL_PORT#" -e "s#{target}#$TARGET#" /torrc.template >/tmp/torrc \
  11. && tor -f /tmp/torrc