Download Dockerfile from Gnetum/proxy: direct link, hf CLI and curl.
- Browser
- Download file 644 Bytes
-
https://huggingface.co/spaces/Gnetum/proxy/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Gnetum/proxy/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Gnetum/proxy/resolve/main/Dockerfile
644 Bytes
| # 1. Usa un'immagine leggera | |
| FROM python:3.12-slim | |
| # 2. Crea un utente non-root per sicurezza (richiesto da HF per le best practice) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:${PATH}" | |
| # 3. Imposta la directory di lavoro nella home dell'utente | |
| WORKDIR /home/user/app | |
| # 4. Copia i file (la proprietà passa all'utente 'user') | |
| COPY --chown=user . . | |
| # 5. Installa le dipendenze | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # 6. Esponi la porta standard di HF | |
| EXPOSE 7860 | |
| # 7. Avvia l'app assicurandoti che Flask usi la porta corretta | |
| CMD ["python", "app.py"] |