-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 919 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 919 Bytes
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
FROM --platform=$BUILDPLATFORM alpine:3.23
LABEL maintainer="hundehausen"
LABEL description="Tor Hidden Service Docker Image"
# Set Tor version - this will be updated by DependencyBot
ENV TOR_VERSION=0.4.9.6-r0
# Install packages & Create directory
RUN apk add --no-cache \
tor=${TOR_VERSION} \
curl \
ca-certificates \
su-exec \
&& chown -R tor:tor /var/lib/tor/ \
&& chmod -R 700 /var/lib/tor/ \
&& rm -rf /var/cache/apk/*
# Copy configuration files and scripts
COPY torrc /etc/tor/torrc
COPY entrypoint.sh /entrypoint.sh
# Make the entrypoint script executable
RUN chmod +x /entrypoint.sh
HEALTHCHECK --interval=300s --timeout=3s \
CMD curl -sS --socks5-hostname localhost:9050 https://check.torproject.org/ | grep -q Congratulations
# Expose the Tor SOCKS port
EXPOSE 9050
# Set the entrypoint
ENTRYPOINT ["/entrypoint.sh"]
# Default command
CMD ["tor", "-f", "/etc/tor/torrc"]