-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (46 loc) · 1.18 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
51
52
53
54
55
# run a tor relay in a container
#
# Bridge relay:
# docker run -d \
# --restart always \
# -v /etc/localtime:/etc/localtime:ro \
# -p 9001:9001 \
# --name tor-relay \
# chenjia404/tor-relay -f /etc/tor/torrc.bridge
#
# Exit relay:
# docker run -d \
# --restart always \
# -v /etc/localtime:/etc/localtime:ro \
# -p 9001:9001 \
# --name tor-relay \
# chenjia404/tor-relay -f /etc/tor/torrc.exit
#
FROM alpine:3
LABEL maintainer "chenjia404 <[email protected]>"
RUN apk --no-cache add \
bash \
tor
# default port to used for incoming Tor connections
# can be changed by changing 'ORPort' in torrc
EXPOSE 9001
# copy in our torrc files
COPY torrc.bridge /etc/tor/torrc.bridge
COPY torrc.middle /etc/tor/torrc.middle
COPY torrc.exit /etc/tor/torrc.exit
# copy the run script
COPY run.sh /run.sh
RUN chmod ugo+rx /run.sh
# default environment variables
ENV RELAY_NICKNAME default
ENV RELAY_TYPE middle
ENV RELAY_BANDWIDTH_RATE 10000 KBytes
ENV RELAY_BANDWIDTH_BURST 20000 KBytes
ENV RELAY_PORT 9001
# make sure files are owned by tor user
RUN chown -R tor /etc/tor
USER tor
RUN mkdir /var/lib/tor/.tor
VOLUME /var/lib/tor/.tor
RUN chown -R tor /var/lib/tor/.tor
ENTRYPOINT [ "/run.sh" ]