add dockerfile and config

This commit is contained in:
2024-11-03 14:44:12 +03:00
commit 30dccfe188
3 changed files with 38 additions and 0 deletions

9
docker-compose.yml Normal file
View File

@@ -0,0 +1,9 @@
services:
tor:
build:
context: ./docker
dockerfile: Dockerfile
image: bitdeals/tor
volumes:
- tor:/var/lib/tor/hidden-service

15
docker/Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
## syntax=docker/dockerfile:3
FROM alpine
# Install tor
RUN apk --no-cache add tor
# Copy config
COPY ./torrc /etc/tor/torrc
CMD chmod 700 /var/lib/tor/hidden-service ;\
chown -R tor /var/lib/tor/hidden-service;\
cat /var/lib/tor/hidden-service/hostname 2>/dev/null;\
/usr/bin/tor -f /etc/tor/torrc --runasdaemon 0

14
docker/torrc Normal file
View File

@@ -0,0 +1,14 @@
#GENERAL OPTIONS
Log notice stderr
User tor
SocksPort 0
DataDirectory /var/lib/tor
HardwareAccel 1
NoExec 1
Sandbox 1
#SERVER OPTIONS
HiddenServiceDir /var/lib/tor/hidden-service/
HiddenServicePort 80 nginx:80