saeid1999 commited on
Commit
98f65ca
·
verified ·
1 Parent(s): 38e6cd8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -11
Dockerfile CHANGED
@@ -1,34 +1,24 @@
1
  FROM python:3.9-slim
2
 
3
- # Set environment variables
4
  ENV PYTHONUNBUFFERED=1
5
  ENV PYTHONDONTWRITEBYTECODE=1
6
 
7
- # Install system dependencies and create user in one layer
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
10
  curl \
11
  && rm -rf /var/lib/apt/lists/* \
12
  && useradd -m -u 1000 user
13
 
14
- # Set work directory
15
  WORKDIR /home/user/app
16
 
17
- # Copy requirements and install packages
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
20
  pip install --no-cache-dir -r requirements.txt
21
 
22
- # Copy application code and set ownership
23
  COPY . .
24
  RUN chown -R user:user /home/user/app
25
-
26
- # Switch to user and create data directory
27
  USER user
28
- RUN mkdir -p data
29
 
30
- # Expose port
31
  EXPOSE 7860
32
 
33
- # Use uvicorn directly
34
- CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9-slim
2
 
 
3
  ENV PYTHONUNBUFFERED=1
4
  ENV PYTHONDONTWRITEBYTECODE=1
5
 
 
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
9
  && rm -rf /var/lib/apt/lists/* \
10
  && useradd -m -u 1000 user
11
 
 
12
  WORKDIR /home/user/app
13
 
 
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
16
  pip install --no-cache-dir -r requirements.txt
17
 
 
18
  COPY . .
19
  RUN chown -R user:user /home/user/app
 
 
20
  USER user
 
21
 
 
22
  EXPOSE 7860
23
 
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]