-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1730f4
commit 2719475
Showing
6 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.temp | ||
tor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM nginx:1.20-alpine | ||
|
||
# Metadata about the docker image | ||
LABEL name="tor-nginx-proxy" | ||
LABEL version="1.0.0-beta-1.0" | ||
LABEL maintainer="Harshit Budhraja (https://github.com/harshit-budhraja)" | ||
|
||
# Update packages and install tor | ||
RUN apk --update --allow-untrusted --repository http://dl-4.alpinelinux.org/alpine/edge/community/ add \ | ||
tor && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* | ||
|
||
# Copy nginx and tor configurations | ||
COPY default.conf.template /etc/nginx/templates/default.conf.template | ||
COPY torrc /etc/tor/torrc | ||
|
||
# Add script to start tor | ||
COPY start-tor.sh /docker-entrypoint.d/40-start-tor.sh | ||
RUN chmod +x /docker-entrypoint.d/40-start-tor.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
server { | ||
listen ${NGINX_PORT}; | ||
|
||
location / { | ||
proxy_pass ${NGINX_PROXY_URL}; | ||
proxy_set_header Host $host:$server_port; | ||
proxy_set_header X-Forwarded-For $remote_addr; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection upgrade; | ||
proxy_set_header Accept-Encoding gzip; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
version: '3' | ||
|
||
services: | ||
tor-nginx-proxy: | ||
container_name: tor-nginx-proxy | ||
image: harshitbudhraja/tor-nginx-proxy:latest | ||
restart: unless-stopped | ||
environment: | ||
- NGINX_PORT=80 | ||
- NGINX_PROXY_URL=<YOUR_APP_URL> | ||
ports: | ||
- 3000:80 | ||
volumes: | ||
- ./tor:/var/lib/tor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
tor -f /etc/tor/torrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
HiddenServiceDir /var/lib/tor/hidden_service/ | ||
HiddenServicePort 80 127.0.0.1:80 | ||
Log notice stdout | ||
RunAsDaemon 1 |