Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -9
Dockerfile
CHANGED
@@ -3,21 +3,21 @@ FROM python:3.10-slim
|
|
3 |
# Set working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
# Install
|
7 |
-
RUN apt-get update && apt-get install -y
|
8 |
-
build-essential \
|
9 |
-
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
-
#
|
|
|
|
|
|
|
12 |
COPY requirements.txt .
|
13 |
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
14 |
|
15 |
-
# Copy
|
16 |
COPY . .
|
17 |
|
18 |
-
# Expose port
|
19 |
EXPOSE 7860
|
20 |
|
21 |
-
|
22 |
-
# Run Uvicorn server
|
23 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
3 |
# Set working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Install dependencies
|
7 |
+
RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
8 |
|
9 |
+
# Set a writable Hugging Face cache directory
|
10 |
+
ENV TRANSFORMERS_CACHE=/app/hf_cache
|
11 |
+
|
12 |
+
# Copy requirements and install
|
13 |
COPY requirements.txt .
|
14 |
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
+
# Copy app files
|
17 |
COPY . .
|
18 |
|
19 |
+
# Expose port
|
20 |
EXPOSE 7860
|
21 |
|
22 |
+
# Run the app
|
|
|
23 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|