Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +33 -33
Dockerfile
CHANGED
|
@@ -1,33 +1,33 @@
|
|
| 1 |
-
# Use official Python base
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
-
|
| 4 |
-
# Set working directory
|
| 5 |
-
WORKDIR /
|
| 6 |
-
|
| 7 |
-
# Set locales and UTF-8
|
| 8 |
-
ENV LANG=C.UTF-8
|
| 9 |
-
ENV LC_ALL=C.UTF-8
|
| 10 |
-
|
| 11 |
-
# Set Hugging Face cache
|
| 12 |
-
ENV HF_HOME="/data/huggingface-cache"
|
| 13 |
-
ENV TRANSFORMERS_CACHE="/data/huggingface-cache"
|
| 14 |
-
|
| 15 |
-
# Install system dependencies
|
| 16 |
-
RUN apt-get update && \
|
| 17 |
-
apt-get install -y --no-install-recommends git build-essential && \
|
| 18 |
-
rm -rf /var/lib/apt/lists/*
|
| 19 |
-
|
| 20 |
-
# Copy requirements
|
| 21 |
-
COPY requirements.txt .
|
| 22 |
-
|
| 23 |
-
# Install Python dependencies
|
| 24 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
-
|
| 26 |
-
# Copy app files
|
| 27 |
-
COPY . .
|
| 28 |
-
|
| 29 |
-
# Expose port
|
| 30 |
-
EXPOSE 7860
|
| 31 |
-
|
| 32 |
-
# Start Uvicorn
|
| 33 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use official Python base
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /code
|
| 6 |
+
|
| 7 |
+
# Set locales and UTF-8
|
| 8 |
+
ENV LANG=C.UTF-8
|
| 9 |
+
ENV LC_ALL=C.UTF-8
|
| 10 |
+
|
| 11 |
+
# Set Hugging Face cache
|
| 12 |
+
ENV HF_HOME="/data/huggingface-cache"
|
| 13 |
+
ENV TRANSFORMERS_CACHE="/data/huggingface-cache"
|
| 14 |
+
|
| 15 |
+
# Install system dependencies
|
| 16 |
+
RUN apt-get update && \
|
| 17 |
+
apt-get install -y --no-install-recommends git build-essential && \
|
| 18 |
+
rm -rf /var/lib/apt/lists/*
|
| 19 |
+
|
| 20 |
+
# Copy requirements
|
| 21 |
+
COPY requirements.txt .
|
| 22 |
+
|
| 23 |
+
# Install Python dependencies
|
| 24 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
+
|
| 26 |
+
# Copy app files
|
| 27 |
+
COPY . .
|
| 28 |
+
|
| 29 |
+
# Expose port
|
| 30 |
+
EXPOSE 7860
|
| 31 |
+
|
| 32 |
+
# Start Uvicorn
|
| 33 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|