| FROM debian:stable |
|
|
| |
| RUN apt-get update && \ |
| apt-get install -y git wget python3 python3-pip unzip && \ |
| rm -rf /var/cache/apt/archives /var/lib/apt/lists/* |
|
|
| RUN mkdir -p /var/log/app |
|
|
| |
| RUN git clone "https://git.evulid.cc/cyberes/huggingface-proxy.git" /app/huggingface |
|
|
| |
| COPY ./rathole-client.toml /app/huggingface/rathole-client.toml |
| COPY ./server.py /app/huggingface/space/server.py |
|
|
| |
| RUN wget https://github.com/rapiz1/rathole/releases/download/v0.5.0/rathole-x86_64-unknown-linux-gnu.zip -O /tmp/rathole.zip |
| RUN unzip /tmp/rathole.zip -d /app |
|
|
| |
| RUN pip install --break-system-packages supervisor requests flask proxy.py "httpx[http2]" |
|
|
| |
| RUN adduser --disabled-password --gecos '' --uid 1000 newuser |
| RUN chown -R newuser:newuser /app |
|
|
| |
| EXPOSE 7860 |
|
|
| USER newuser |
|
|
| |
| CMD cd /app && /usr/local/bin/supervisord -c /app/huggingface/space/supervisord.conf |