Spaces:
Running
Running
khurrameycon
commited on
Update Dockerfile
Browse files- Dockerfile +7 -4
Dockerfile
CHANGED
@@ -1,18 +1,21 @@
|
|
1 |
# Use the official Python slim image
|
2 |
FROM python:3.8-slim
|
3 |
|
4 |
-
# Set
|
|
|
|
|
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Copy
|
8 |
COPY requirements.txt .
|
9 |
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
|
11 |
-
# Copy
|
12 |
COPY . .
|
13 |
|
14 |
# Expose the port FastAPI will run on
|
15 |
EXPOSE 7860
|
16 |
|
17 |
-
#
|
18 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
# Use the official Python slim image
|
2 |
FROM python:3.8-slim
|
3 |
|
4 |
+
# Set environment variable for Hugging Face cache
|
5 |
+
ENV HF_HOME=/tmp/.huggingface
|
6 |
+
|
7 |
+
# Working directory
|
8 |
WORKDIR /app
|
9 |
|
10 |
+
# Copy dependencies
|
11 |
COPY requirements.txt .
|
12 |
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
|
14 |
+
# Copy application code
|
15 |
COPY . .
|
16 |
|
17 |
# Expose the port FastAPI will run on
|
18 |
EXPOSE 7860
|
19 |
|
20 |
+
# Run the API
|
21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|