Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +11 -6
Dockerfile
CHANGED
|
@@ -1,17 +1,22 @@
|
|
| 1 |
-
# Use the official Python image as a base
|
| 2 |
FROM python:3.12
|
| 3 |
|
| 4 |
-
# Set
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install
|
| 8 |
RUN pip install tensorflow==2.16.2 fastapi uvicorn requests pillow python-multipart
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
# Copy the FastAPI application code into the container
|
| 11 |
COPY . .
|
| 12 |
|
| 13 |
-
#
|
|
|
|
|
|
|
|
|
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
-
# Run the FastAPI application
|
| 17 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.12
|
| 2 |
|
| 3 |
+
# Set a working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Install required packages
|
| 7 |
RUN pip install tensorflow==2.16.2 fastapi uvicorn requests pillow python-multipart
|
| 8 |
|
| 9 |
+
# Ensure the application has a writable temp directory
|
| 10 |
+
RUN mkdir -p /app/temp && chmod 777 /app/temp
|
| 11 |
+
|
| 12 |
# Copy the FastAPI application code into the container
|
| 13 |
COPY . .
|
| 14 |
|
| 15 |
+
# Set environment variable for temporary files
|
| 16 |
+
ENV TMP_DIR=/app/temp
|
| 17 |
+
|
| 18 |
+
# Expose port for FastAPI
|
| 19 |
EXPOSE 7860
|
| 20 |
|
| 21 |
+
# Run the FastAPI application
|
| 22 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|