Spaces:
Paused
Paused
| FROM python:3.10-slim | |
| WORKDIR /code | |
| # 1. Install System Dependencies (SSHFS + Curl) | |
| RUN apt-get update && apt-get install -y \ | |
| sshfs \ | |
| curl \ | |
| fuse \ | |
| dos2unix \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Enable FUSE for non-root users | |
| RUN echo "user_allow_other" >> /etc/fuse.conf | |
| # 2. Install Cloudflared | |
| RUN curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && \ | |
| dpkg -i cloudflared.deb && \ | |
| rm cloudflared.deb | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Create mount point | |
| RUN mkdir -p /data/persistent && chmod 777 /data/persistent | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| COPY --chown=user . $HOME/app | |
| # Fix permissions and formatting | |
| RUN chmod +x mount_azure.sh entrypoint.sh && \ | |
| dos2unix mount_azure.sh entrypoint.sh | |
| # El puerto 7860 es obligatorio en Hugging Face Spaces | |
| CMD ["./entrypoint.sh"] |