Update Dockerfile
Browse files- Dockerfile +19 -2
Dockerfile
CHANGED
|
@@ -1,12 +1,23 @@
|
|
| 1 |
-
# Use a stable Python base
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
|
|
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Upgrade pip
|
| 7 |
RUN pip install --no-cache-dir --upgrade pip
|
| 8 |
|
| 9 |
-
# Install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
RUN pip install --no-cache-dir \
|
| 11 |
datasets \
|
| 12 |
"huggingface-hub>=0.30" \
|
|
@@ -21,3 +32,9 @@ RUN pip install --no-cache-dir \
|
|
| 21 |
accelerate==1.13.0 \
|
| 22 |
--index-url https://download.pytorch.org/whl/cpu \
|
| 23 |
torch==2.11.0+cpu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a stable Python base image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# Upgrade pip
|
| 8 |
RUN pip install --no-cache-dir --upgrade pip
|
| 9 |
|
| 10 |
+
# Install system dependencies (minimal set for Streamlit/Gradio apps)
|
| 11 |
+
RUN apt-get update && apt-get install -y \
|
| 12 |
+
git git-lfs ffmpeg libsm6 libxext6 libgl1 curl \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 14 |
+
&& git lfs install
|
| 15 |
+
|
| 16 |
+
# Copy project files into container
|
| 17 |
+
COPY . /app
|
| 18 |
+
|
| 19 |
+
# Install Python dependencies
|
| 20 |
+
# CPU-only PyTorch avoids multi-GB CUDA downloads
|
| 21 |
RUN pip install --no-cache-dir \
|
| 22 |
datasets \
|
| 23 |
"huggingface-hub>=0.30" \
|
|
|
|
| 32 |
accelerate==1.13.0 \
|
| 33 |
--index-url https://download.pytorch.org/whl/cpu \
|
| 34 |
torch==2.11.0+cpu
|
| 35 |
+
|
| 36 |
+
# Expose default port for Streamlit
|
| 37 |
+
EXPOSE 7860
|
| 38 |
+
|
| 39 |
+
# Run your app (adjust filename if needed)
|
| 40 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|