Spaces:
Runtime error
Runtime error
moved docker file
Browse files
.dockerignore → backend/.dockerignore
RENAMED
|
File without changes
|
Dockerfile → backend/Dockerfile
RENAMED
|
@@ -4,20 +4,21 @@ FROM python:3.11.5
|
|
| 4 |
|
| 5 |
EXPOSE 7860
|
| 6 |
|
| 7 |
-
#
|
| 8 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 9 |
ENV PYTHONUNBUFFERED=1
|
| 10 |
|
| 11 |
-
#
|
|
|
|
|
|
|
|
|
|
| 12 |
COPY requirements.txt .
|
| 13 |
-
RUN python -m pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
|
| 17 |
-
COPY . /app
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "-k", "uvicorn.workers.UvicornWorker", "
|
|
|
|
| 4 |
|
| 5 |
EXPOSE 7860
|
| 6 |
|
| 7 |
+
# Prevents Python from generating .pyc files and turns off buffering
|
| 8 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 9 |
ENV PYTHONUNBUFFERED=1
|
| 10 |
|
| 11 |
+
# Set the working directory inside the container
|
| 12 |
+
WORKDIR /app
|
| 13 |
+
|
| 14 |
+
# Copy only the requirements file first (better for caching)
|
| 15 |
COPY requirements.txt .
|
|
|
|
| 16 |
|
| 17 |
+
# Install dependencies
|
| 18 |
+
RUN python -m pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 19 |
|
| 20 |
+
# Copy the rest of the application code
|
| 21 |
+
COPY . .
|
| 22 |
|
| 23 |
+
# Run the FastAPI app with Gunicorn
|
| 24 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "-k", "uvicorn.workers.UvicornWorker", "main:app"]
|