ayushirathour commited on
Commit
f76ab82
·
verified ·
1 Parent(s): 9346282

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -11
Dockerfile CHANGED
@@ -2,22 +2,18 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies
6
  RUN apt-get update && \
7
  apt-get install -y gcc g++ && \
8
- apt-get clean && \
9
- rm -rf /var/lib/apt/lists/*
10
-
11
- # Install Python packages
12
- COPY requirements.txt ./
13
- RUN pip install --upgrade pip
14
- RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Copy application
17
  COPY . ./
18
 
19
- # Expose port
20
  EXPOSE 7860
21
 
22
- # Run the application
 
 
 
23
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
 
3
  WORKDIR /app
4
 
5
+ COPY requirements.txt ./
6
  RUN apt-get update && \
7
  apt-get install -y gcc g++ && \
8
+ pip install --upgrade pip && \
9
+ pip install -r requirements.txt
 
 
 
 
 
10
 
 
11
  COPY . ./
12
 
 
13
  EXPOSE 7860
14
 
15
+ RUN useradd -m appuser
16
+ RUN chown -R appuser /app
17
+ USER appuser
18
+
19
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]