Niansuh commited on
Commit
699242b
·
verified ·
1 Parent(s): 70b0d46

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -17
Dockerfile CHANGED
@@ -1,26 +1,17 @@
1
- # Use the official Python image from the Docker Hub
2
- FROM python:3.11-slim
3
 
4
- # Set environment variables
5
- ENV PYTHONDONTWRITEBYTECODE=1
6
- ENV PYTHONUNBUFFERED=1
7
-
8
- # Set work directory
9
  WORKDIR /app
10
 
11
- # Install system dependencies
12
- RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*
13
 
14
- # Install Python dependencies
15
- COPY requirements.txt .
16
- RUN pip install --upgrade pip
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy the application code
20
- COPY . .
21
-
22
- # Expose the port that the app runs on
23
  EXPOSE 7860
24
 
25
- # Define the default command to run the app
26
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
 
4
+ # Set the working directory in the container
 
 
 
 
5
  WORKDIR /app
6
 
7
+ # Copy the current directory contents into the container at /app
8
+ COPY . /app
9
 
10
+ # Install dependencies
 
 
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Expose the port the app runs on
 
 
 
14
  EXPOSE 7860
15
 
16
+ # Run the application
17
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]