triflix commited on
Commit
4249472
·
verified ·
1 Parent(s): fd2e634

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -15
Dockerfile CHANGED
@@ -1,24 +1,18 @@
1
  # Use an official Python runtime as a base image
2
  FROM python:3.9-slim
3
 
4
- # Set the working directory in the container
5
  WORKDIR /app
6
 
7
- # Optionally copy a requirements.txt file (if you have one)
8
- # If no requirements.txt is provided, install the required packages directly.
9
- COPY requirements.txt ./
10
-
11
- RUN if [ -f requirements.txt ]; then \
12
- pip install --upgrade pip && \
13
- pip install -r requirements.txt; \
14
- else \
15
- pip install --upgrade pip && \
16
- pip install fastapi uvicorn[standard] jinja2; \
17
- fi
18
-
19
  COPY . .
20
 
21
- EXPOSE 7860
 
 
22
 
 
 
23
 
24
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  # Use an official Python runtime as a base image
2
  FROM python:3.9-slim
3
 
4
+ # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Copy the entire project into the container
 
 
 
 
 
 
 
 
 
 
 
8
  COPY . .
9
 
10
+ # Install FastAPI, Uvicorn (with standard extras), and Jinja2
11
+ RUN pip install --upgrade pip && \
12
+ pip install fastapi uvicorn[standard] jinja2
13
 
14
+ # Expose the default port for HuggingFace Spaces
15
+ EXPOSE 7860
16
 
17
+ # Run the app on port 7860
18
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]