Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +7 -16
Dockerfile
CHANGED
|
@@ -3,21 +3,12 @@ FROM python:3.9-slim
|
|
| 3 |
# Set the working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
# Copy the
|
| 7 |
-
COPY
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 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 |
-
#
|
| 16 |
-
|
| 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"]
|
|
|
|
| 3 |
# Set the working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Copy all files from the build context root into the container's working directory
|
| 7 |
+
COPY . /app/
|
| 8 |
|
| 9 |
+
# Install dependencies from the requirements file
|
| 10 |
+
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
# Define the command to start the application using Gunicorn
|
| 13 |
+
# The app is now at /app/app.py
|
| 14 |
+
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:superkart_api"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|