Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +12 -5
Dockerfile
CHANGED
|
@@ -3,14 +3,21 @@ FROM python:3.9-slim
|
|
| 3 |
# Set the working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
# Copy
|
| 7 |
-
COPY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Install dependencies from the requirements file without using cache to reduce image size
|
| 10 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 11 |
|
| 12 |
# Define the command to start the application using Gunicorn with 4 worker processes
|
| 13 |
# - `-w 4`: Uses 4 worker processes for handling requests
|
| 14 |
# - `-b 0.0.0.0:7860`: Binds the server to port 7860 on all network interfaces
|
| 15 |
-
# - `app:app`: Runs the Flask app (assuming
|
| 16 |
-
|
|
|
|
|
|
| 3 |
# Set the working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Copy the backend_files directory into the container's working directory
|
| 7 |
+
COPY backend_files /app/backend_files
|
| 8 |
+
|
| 9 |
+
# Copy other necessary files (like app.py, requirements.txt if not in backend_files)
|
| 10 |
+
# If app.py and requirements.txt are in the root of backend_files, the above COPY is sufficient.
|
| 11 |
+
# If they are in the root directory where you build the Dockerfile, use:
|
| 12 |
+
# COPY app.py /app/
|
| 13 |
+
# COPY requirements.txt /app/
|
| 14 |
|
| 15 |
# Install dependencies from the requirements file without using cache to reduce image size
|
| 16 |
+
RUN pip install --no-cache-dir --upgrade -r /app/backend_files/requirements.txt
|
| 17 |
|
| 18 |
# Define the command to start the application using Gunicorn with 4 worker processes
|
| 19 |
# - `-w 4`: Uses 4 worker processes for handling requests
|
| 20 |
# - `-b 0.0.0.0:7860`: Binds the server to port 7860 on all network interfaces
|
| 21 |
+
# - `app:app`: Runs the Flask app (assuming app.py is at /app/app.py)
|
| 22 |
+
# Assuming app.py is in backend_files, the path inside the container will be /app/backend_files/app.py
|
| 23 |
+
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "backend_files.app:superkart_api"]
|