Spaces:
Running on Zero
Running on Zero
Upload Dockerfile
Browse files- Dockerfile +39 -0
Dockerfile
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GPU-ready Docker image for the Qwen2.5 Text-to-SQL LoRA Gradio app.
|
| 2 |
+
|
| 3 |
+
FROM python:3.11-slim
|
| 4 |
+
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
+
git \
|
| 7 |
+
curl \
|
| 8 |
+
ca-certificates \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# Hugging Face Docker Spaces run containers as UID 1000.
|
| 12 |
+
RUN useradd -m -u 1000 user
|
| 13 |
+
|
| 14 |
+
USER user
|
| 15 |
+
|
| 16 |
+
ENV HOME=/home/user \
|
| 17 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 18 |
+
PYTHONUNBUFFERED=1 \
|
| 19 |
+
PIP_NO_CACHE_DIR=1 \
|
| 20 |
+
HF_HOME=/home/user/.cache/huggingface \
|
| 21 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
| 22 |
+
GRADIO_SERVER_PORT=7860 \
|
| 23 |
+
PORT=7860
|
| 24 |
+
|
| 25 |
+
WORKDIR $HOME/app
|
| 26 |
+
|
| 27 |
+
COPY --chown=user:user requirements.txt ./requirements.txt
|
| 28 |
+
|
| 29 |
+
# match the successful local (CUDA-enabled) PyTorch training environment
|
| 30 |
+
RUN python -m pip install --upgrade pip && \
|
| 31 |
+
python -m pip install torch==2.11.0 \
|
| 32 |
+
--index-url https://download.pytorch.org/whl/cu128 && \
|
| 33 |
+
python -m pip install -r requirements.txt
|
| 34 |
+
|
| 35 |
+
COPY --chown=user:user . $HOME/app
|
| 36 |
+
|
| 37 |
+
EXPOSE 7860
|
| 38 |
+
|
| 39 |
+
CMD ["python", "app.py"]
|