Spaces:
Runtime error
Runtime error
updated docker
Browse files- Dockerfile +11 -16
Dockerfile
CHANGED
|
@@ -2,27 +2,22 @@
|
|
| 2 |
# Use the official Python 3.11.5 image
|
| 3 |
FROM python:3.11.5
|
| 4 |
|
| 5 |
-
# Expose FastAPI port
|
| 6 |
EXPOSE 7860
|
| 7 |
|
| 8 |
-
#
|
| 9 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 10 |
-
|
| 11 |
-
# Turns off buffering for easier logging
|
| 12 |
ENV PYTHONUNBUFFERED=1
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
# Copy only the backend folder
|
| 18 |
-
COPY backend/ /app/
|
| 19 |
-
|
| 20 |
-
# Install dependencies from the backend folder
|
| 21 |
RUN python -m pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
# Start FastAPI
|
| 28 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "-k", "uvicorn.workers.UvicornWorker", "main:app"]
|
|
|
|
| 2 |
# Use the official Python 3.11.5 image
|
| 3 |
FROM python:3.11.5
|
| 4 |
|
|
|
|
| 5 |
EXPOSE 7860
|
| 6 |
|
| 7 |
+
# Environment settings
|
| 8 |
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
|
|
| 9 |
ENV PYTHONUNBUFFERED=1
|
| 10 |
|
| 11 |
+
# Install dependencies
|
| 12 |
+
COPY requirements.txt .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
RUN python -m pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
+
# Set working directory
|
| 16 |
+
WORKDIR /app
|
| 17 |
+
COPY . /app
|
| 18 |
+
|
| 19 |
+
# Ensure correct permissions (optional but recommended)
|
| 20 |
+
RUN chown -R root:root /app
|
| 21 |
|
| 22 |
+
# Start the FastAPI application
|
| 23 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "-k", "uvicorn.workers.UvicornWorker", "backend.main:app"]
|