File size: 736 Bytes
dc3394d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM alpine:latest

# Install Tor, Python, and dependencies
RUN apk update && \
    apk add tor python3 py3-pip curl --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ && \
    rm -rf /var/cache/apk/*

# Install Python dependencies
COPY requirements.txt /app/requirements.txt
RUN pip3 install --no-cache-dir -r /app/requirements.txt

# Copy application files
COPY app.py /app/app.py
COPY torrc /etc/tor/torrc

# Set permissions for Tor
RUN chown -R tor /etc/tor

# Create app directory and set permissions
WORKDIR /app
RUN mkdir -p /var/lib/tor && chown -R tor /var/lib/tor

# Expose Flask and SOCKS5 ports
EXPOSE 5000 9050

# Start Tor in background and Flask app
CMD ["sh", "-c", "tor & python3 /app/app.py"]