Add initial Docker setup with Nginx, SSH, and Tor services

This commit is contained in:
whaffman 2025-07-03 15:35:11 +02:00
parent 2da450b796
commit 81cc7c3b43
6 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,17 @@
FROM alpine:3.20
RUN apk update && \
apk upgrade && \
apk add --no-cache nginx, openssh, tor \
&& rm -rf /var/cache/apk/*
COPY nginx.conf /etc/nginx/nginx.conf
COPY torrc /etc/tor/torrc
COPY sshd_config /etc/ssh/sshd_config
COPY index.html /var/www/html/index.html
COPY entrypoint.sh /entrypoint.sh
EXPOSE 4242
CMD ["sh", "-c", "nginx && tor -f /etc/tor/torrc"]

13
entrypoint.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
# Start the SSH service
/usr/sbin/sshd -D &
# Start the Nginx service
nginx -g 'daemon off;' &
# Start the Tor service
tor -f /etc/tor/torrc &
# Keep the script running to prevent container exit
tail -f /dev/null

24
index.html Normal file
View File

@ -0,0 +1,24 @@
<html>
<head>
<title>Welcome to ft_onion</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
text-align: center;
padding: 50px;
}
h1 {
color: #2c3e50;
}
p {
font-size: 18px;
}
</style>
</head>
<body>
<h1>Welcome to ft_onion</h1>
<p>This is a hidden service running on Tor.</p>
</body>
</html>

10
nginx.conf Normal file
View File

@ -0,0 +1,10 @@
server {
listen 80;
server_name
location / {
root /var/www/html;
index index.html index.htm;
try_files $uri $uri/ =404;
}
}

10
sshd_config Normal file
View File

@ -0,0 +1,10 @@
# Basic SSHD Configuration
Port 4242
PermitRootLogin yes
PasswordAuthentication yes
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding no
AllowTcpForwarding no
PermitEmptyPasswords no

6
torrc Normal file
View File

@ -0,0 +1,6 @@
# Basic torrc configuration
SocksPort 9050
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80