Niansuh commited on
Commit
fa56da3
·
verified ·
1 Parent(s): 92def1a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -9
Dockerfile CHANGED
@@ -1,20 +1,25 @@
1
  # Dockerfile
 
 
2
  FROM python:3.11-slim
3
 
4
- # Set the working directory in the container
 
 
 
 
5
  WORKDIR /app
6
 
7
- # Copy the requirements file into the container
8
  COPY requirements.txt .
 
 
9
 
10
- # Install the dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
12
-
13
- # Copy the application code into the container
14
  COPY . .
15
 
16
- # Expose the port that the app runs on
17
  EXPOSE 8000
18
 
19
- # Command to run the application
20
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
 
1
  # Dockerfile
2
+
3
+ # Use official Python image as base
4
  FROM python:3.11-slim
5
 
6
+ # Set environment variables
7
+ ENV PYTHONDONTWRITEBYTECODE=1
8
+ ENV PYTHONUNBUFFERED=1
9
+
10
+ # Set work directory
11
  WORKDIR /app
12
 
13
+ # Install dependencies
14
  COPY requirements.txt .
15
+ RUN pip install --upgrade pip
16
+ RUN pip install -r requirements.txt
17
 
18
+ # Copy project
 
 
 
19
  COPY . .
20
 
21
+ # Expose port
22
  EXPOSE 8000
23
 
24
+ # Run the application
25
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]