AronWolverine commited on
Commit
65de8cb
·
verified ·
1 Parent(s): 6ef2957

Update dockerfile

Browse files
Files changed (1) hide show
  1. dockerfile +6 -16
dockerfile CHANGED
@@ -1,27 +1,17 @@
1
- # Declare your environment variables with the ARG directive
2
- ARG MODEL_REPO_NAME
3
-
4
- # Use the official Python image
5
  FROM python:3.9
6
 
7
- # Set the working directory inside the container
8
  WORKDIR /app
9
 
10
  # Copy application files
11
  COPY . .
12
 
13
- # Install required dependencies
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Use the build-time variable in the command
17
- RUN python predict.py $MODEL_REPO_NAME
18
-
19
- # Expose the correct port for Hugging Face Spaces
20
  EXPOSE 7860
21
 
22
- # Set Flask environment variables
23
- ENV FLASK_APP=app.py
24
- ENV FLASK_RUN_HOST=0.0.0.0
25
-
26
- # Run the Flask application on port 7860
27
- CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]
 
1
+ # Use official Python runtime
 
 
 
2
  FROM python:3.9
3
 
4
+ # Set the working directory
5
  WORKDIR /app
6
 
7
  # Copy application files
8
  COPY . .
9
 
10
+ # Install dependencies
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Expose the correct port for FastAPI
 
 
 
14
  EXPOSE 7860
15
 
16
+ # Run the FastAPI app with Uvicorn
17
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]