Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +3 -10
Dockerfile
CHANGED
|
@@ -1,28 +1,21 @@
|
|
| 1 |
-
# Lightweight Python image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Disable CUDA & set cache
|
| 5 |
ENV TORCH_DISABLE_CUDA=1
|
| 6 |
ENV HF_HOME=/app/hf_cache
|
| 7 |
ENV TRANSFORMERS_CACHE=/app/hf_cache
|
| 8 |
|
| 9 |
-
# Working directory
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
-
# Install dependencies
|
| 13 |
COPY requirements.txt .
|
|
|
|
| 14 |
RUN apt-get update && apt-get install -y git && \
|
| 15 |
pip install --no-cache-dir -r requirements.txt && \
|
| 16 |
rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
-
# Copy app code and model/data
|
| 19 |
COPY . .
|
| 20 |
|
| 21 |
-
# Make cache folder writable
|
| 22 |
RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
|
| 23 |
|
| 24 |
-
|
| 25 |
-
EXPOSE 8080
|
| 26 |
|
| 27 |
-
|
| 28 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
ENV TORCH_DISABLE_CUDA=1
|
| 4 |
ENV HF_HOME=/app/hf_cache
|
| 5 |
ENV TRANSFORMERS_CACHE=/app/hf_cache
|
| 6 |
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
|
|
|
|
| 9 |
COPY requirements.txt .
|
| 10 |
+
|
| 11 |
RUN apt-get update && apt-get install -y git && \
|
| 12 |
pip install --no-cache-dir -r requirements.txt && \
|
| 13 |
rm -rf /var/lib/apt/lists/*
|
| 14 |
|
|
|
|
| 15 |
COPY . .
|
| 16 |
|
|
|
|
| 17 |
RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
|
| 18 |
|
| 19 |
+
EXPOSE 7860
|
|
|
|
| 20 |
|
| 21 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|