Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -10
Dockerfile
CHANGED
@@ -1,24 +1,29 @@
|
|
1 |
-
#
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
-
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Install
|
8 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
9 |
|
10 |
-
#
|
11 |
COPY requirements.txt .
|
12 |
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
|
14 |
-
# Copy
|
15 |
COPY . .
|
16 |
|
17 |
-
#
|
18 |
-
EXPOSE 7860
|
19 |
-
|
20 |
-
# Create cache folder with write permissions
|
21 |
RUN mkdir -p /app/cache
|
22 |
|
23 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Dockerfile for PromptAgro
|
2 |
FROM python:3.10-slim
|
3 |
|
|
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Install system dependencies
|
7 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
+
# Install Python dependencies
|
10 |
COPY requirements.txt .
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
+
# Copy app code
|
14 |
COPY . .
|
15 |
|
16 |
+
# Pre-create cache directory (optional)
|
|
|
|
|
|
|
17 |
RUN mkdir -p /app/cache
|
18 |
|
19 |
+
# Set up cache directories and environment variables
|
20 |
+
RUN mkdir -p /tmp/huggingface_cache
|
21 |
+
ENV HF_HOME=/tmp/huggingface_cache
|
22 |
+
ENV TRANSFORMERS_CACHE=/tmp/huggingface_cache
|
23 |
+
ENV HF_HUB_CACHE=/tmp/huggingface_cache
|
24 |
+
|
25 |
+
# Expose port
|
26 |
+
EXPOSE 7860
|
27 |
+
|
28 |
+
# Start FastAPI app
|
29 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|