iechambless commited on
Commit
c8feb75
·
verified ·
1 Parent(s): a8c0a34

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. 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 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"]
 
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"]