DevClivora commited on
Commit
819ffed
·
verified ·
1 Parent(s): 0217b8b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -7,9 +7,11 @@ FROM python:3.9-slim
7
  # 2. Set the working directory inside the container.
8
  WORKDIR /code
9
 
10
- # 3. Set the HF_HOME environment variable to a writable directory.
11
  # This prevents the /.cache permission error.
12
  ENV HF_HOME="/tmp/.cache/huggingface"
 
 
13
 
14
  # 4. Copy the requirements file into the working directory.
15
  COPY ./requirements.txt /code/requirements.txt
@@ -23,7 +25,5 @@ COPY ./ /code/
23
  # 7. Expose the port that the application will run on.
24
  EXPOSE 7860
25
 
26
- # 8. Define the command to run the application using Gunicorn (production standard).
27
- # This is more robust than `flask run` and explicitly points to the 'app' object
28
- # within the 'app.py' module, which should solve the route discovery issue.
29
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
7
  # 2. Set the working directory inside the container.
8
  WORKDIR /code
9
 
10
+ # 3. Set environment variables.
11
  # This prevents the /.cache permission error.
12
  ENV HF_HOME="/tmp/.cache/huggingface"
13
+ # This explicitly tells Flask which file contains the application.
14
+ ENV FLASK_APP=app.py
15
 
16
  # 4. Copy the requirements file into the working directory.
17
  COPY ./requirements.txt /code/requirements.txt
 
25
  # 7. Expose the port that the application will run on.
26
  EXPOSE 7860
27
 
28
+ # 8. Define the command to run the application using Flask's built-in server.
29
+ CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]