Create Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM alpine:latest
|
2 |
+
|
3 |
+
# Install Tor, Python, and dependencies
|
4 |
+
RUN apk update && \
|
5 |
+
apk add tor python3 py3-pip curl --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ && \
|
6 |
+
rm -rf /var/cache/apk/*
|
7 |
+
|
8 |
+
# Install Python dependencies
|
9 |
+
COPY requirements.txt /app/requirements.txt
|
10 |
+
RUN pip3 install --no-cache-dir -r /app/requirements.txt
|
11 |
+
|
12 |
+
# Copy application files
|
13 |
+
COPY app.py /app/app.py
|
14 |
+
COPY torrc /etc/tor/torrc
|
15 |
+
|
16 |
+
# Set permissions for Tor
|
17 |
+
RUN chown -R tor /etc/tor
|
18 |
+
|
19 |
+
# Create app directory and set permissions
|
20 |
+
WORKDIR /app
|
21 |
+
RUN mkdir -p /var/lib/tor && chown -R tor /var/lib/tor
|
22 |
+
|
23 |
+
# Expose Flask and SOCKS5 ports
|
24 |
+
EXPOSE 5000 9050
|
25 |
+
|
26 |
+
# Start Tor in background and Flask app
|
27 |
+
CMD ["sh", "-c", "tor & python3 /app/app.py"]
|