Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -3
Dockerfile
CHANGED
@@ -1,8 +1,22 @@
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
COPY requirements.txt .
|
5 |
-
RUN pip install -r requirements.txt
|
|
|
|
|
6 |
COPY . .
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
+
# Set environment variables
|
4 |
+
ENV PYTHONUNBUFFERED=1 \
|
5 |
+
PORT=8000 \
|
6 |
+
HF_HOME=/home/user/huggingface
|
7 |
+
|
8 |
+
# Create necessary folders
|
9 |
+
RUN mkdir -p /home/user/huggingface
|
10 |
+
|
11 |
+
# Install dependencies
|
12 |
COPY requirements.txt .
|
13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
+
|
15 |
+
# Copy app files
|
16 |
COPY . .
|
17 |
|
18 |
+
# Expose the port
|
19 |
+
EXPOSE $PORT
|
20 |
+
|
21 |
+
# Run the FastAPI app with uvicorn
|
22 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|