Spaces:
Sleeping
Sleeping
update
Browse files- Dockerfile +12 -7
Dockerfile
CHANGED
@@ -1,14 +1,19 @@
|
|
1 |
FROM python:3.10.12
|
2 |
|
3 |
-
#
|
4 |
-
|
5 |
|
6 |
-
# Set the
|
7 |
-
|
8 |
|
9 |
-
#
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
13 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
14 |
-
|
|
|
1 |
FROM python:3.10.12
|
2 |
|
3 |
+
# Set the working directory in the container
|
4 |
+
WORKDIR /app
|
5 |
|
6 |
+
# Set the environment variable for the Hugging Face cache
|
7 |
+
ENV TRANSFORMERS_CACHE=/app/.cache
|
8 |
|
9 |
+
# Copy the current directory contents into the container at /app
|
10 |
+
COPY . /app
|
11 |
+
|
12 |
+
# Install the Python dependencies from requirements.txt
|
13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
+
|
15 |
+
# Create the cache directory with appropriate permissions
|
16 |
+
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
17 |
|
18 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
19 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|