forked from chriswayg/tor-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
50 lines (42 loc) · 1.44 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Dockerfile for Tor Relay Server with obfs4proxy
FROM debian:bullseye
RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/backports.list
MAINTAINER Josh [email protected]
ARG GPGKEY=A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE="True"
ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND=noninteractive
ARG found=""
# Set a default Nickname
ENV TOR_NICKNAME=Tor4
ENV TOR_USER=tord
ENV TERM=xterm
# Install tor with GeoIP and obfs4proxy & backup torrc
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils \
&& apt-get install -y --no-install-recommends \
pwgen \
iputils-ping \
tor/bullseye-backports \
tor-geoipdb/bullseye-backports \
obfs4proxy/bullseye-backports \
&& mkdir -pv /usr/local/etc/tor/ \
&& mv -v /etc/tor/torrc /usr/local/etc/tor/torrc.sample \
&& apt-get purge --auto-remove -y \
apt-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
# Rename Debian unprivileged user to tord \
&& usermod -l ${TOR_USER} debian-tor \
&& groupmod -n ${TOR_USER} debian-tor
# Copy Tor configuration file
COPY ./torrc /etc/tor/torrc
# Copy docker-entrypoint
COPY ./scripts/ /usr/local/bin/
# Persist data
VOLUME /etc/tor /var/lib/tor
# ORPort, DirPort, SocksPort, ObfsproxyPort, MeekPort
EXPOSE 9001 9030 9050 54444 7002
ENTRYPOINT ["docker-entrypoint"]
CMD ["tor", "-f", "/etc/tor/torrc"]