Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +16 -13
Dockerfile
CHANGED
@@ -1,20 +1,23 @@
|
|
1 |
-
#
|
2 |
-
FROM python:3.9-slim
|
3 |
|
4 |
-
#
|
|
|
|
|
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Copy
|
8 |
-
COPY .
|
9 |
|
10 |
-
# Install
|
11 |
-
RUN pip install
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
|
16 |
-
#
|
17 |
-
|
|
|
18 |
|
19 |
-
#
|
20 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Dockerfile
|
|
|
2 |
|
3 |
+
# Use a base image appropriate for your application
|
4 |
+
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
|
5 |
+
|
6 |
+
# Set working directory
|
7 |
WORKDIR /app
|
8 |
|
9 |
+
# Copy requirements.txt first for caching dependencies
|
10 |
+
COPY ./requirements.txt .
|
11 |
|
12 |
+
# Install dependencies
|
13 |
+
RUN pip install -r requirements.txt
|
14 |
|
15 |
+
# Copy the rest of the application code
|
16 |
+
COPY . .
|
17 |
|
18 |
+
# Create necessary directories and set permissions
|
19 |
+
RUN mkdir -p /app/static/uploads /app/static/results \
|
20 |
+
&& chmod -R 777 /app/static
|
21 |
|
22 |
+
# Start the application
|
23 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|