rishab1090 commited on
Commit
204e078
·
verified ·
1 Parent(s): 6408ce5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -15
Dockerfile CHANGED
@@ -1,10 +1,9 @@
1
- # Base image
2
  FROM python:3.10-slim
3
 
4
- # Set env vars to reduce image size and fix random_device bug
5
- ENV PYTHONDONTWRITEBYTECODE=1 \
6
- PYTHONUNBUFFERED=1 \
7
- PYTHONHASHSEED=0
8
 
9
  # Install dependencies
10
  RUN apt-get update && apt-get install -y \
@@ -13,21 +12,18 @@ RUN apt-get update && apt-get install -y \
13
  libsm6 \
14
  libxrender1 \
15
  libxext6 \
16
- libgl1-mesa-glx \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
  # Set workdir
20
  WORKDIR /app
21
 
22
- # Copy files
23
- COPY . .
24
-
25
- # Install Python dependencies
26
- RUN pip install --upgrade pip
27
  RUN pip install --no-cache-dir -r requirements.txt
28
 
29
- # Expose port
30
- EXPOSE 8000
31
 
32
- # Start API
33
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # Use an official Python runtime
2
  FROM python:3.10-slim
3
 
4
+ # Avoids .pyc files
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
 
7
 
8
  # Install dependencies
9
  RUN apt-get update && apt-get install -y \
 
12
  libsm6 \
13
  libxrender1 \
14
  libxext6 \
15
+ libgl1 \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
  # Set workdir
19
  WORKDIR /app
20
 
21
+ # Copy requirements and install
22
+ COPY requirements.txt .
 
 
 
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
+ # Copy the app code
26
+ COPY . .
27
 
28
+ # Run the app
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]