| FROM alpine:latest |
|
|
| |
| 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/* |
|
|
| |
| WORKDIR /app |
|
|
| |
| COPY requirements.txt /app/requirements.txt |
|
|
| |
| RUN python3 -m venv /app/venv && \ |
| /app/venv/bin/pip install --no-cache-dir -r /app/requirements.txt |
|
|
| |
| COPY app.py /app/app.py |
| COPY torrc /etc/tor/torrc |
| COPY start.sh /app/start.sh |
|
|
| |
| RUN if ! getent group tor >/dev/null; then addgroup -S tor; fi && \ |
| if ! getent passwd tor >/dev/null; then adduser -S -G tor tor; fi && \ |
| mkdir -p /var/lib/tor && \ |
| chown -R tor:tor /etc/tor /var/lib/tor && \ |
| chmod +x /app/start.sh |
|
|
| |
| EXPOSE 5000 9050 |
|
|
| |
| CMD ["/app/start.sh"] |