abdullahalioo commited on
Commit
7159e17
·
verified ·
1 Parent(s): 7856ed7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -23
Dockerfile CHANGED
@@ -1,29 +1,10 @@
1
- # Use official Python slim image for a smaller footprint
2
- FROM python:3.12-slim
3
 
4
- # Set environment variables for security and performance
5
- ENV PYTHONDONTWRITEBYTECODE=1 \
6
- PYTHONUNBUFFERED=1 \
7
- PIP_NO_CACHE_DIR=1
8
-
9
- # Set working directory
10
  WORKDIR /app
11
 
12
- # Copy requirements.txt first for caching
13
  COPY requirements.txt .
 
14
 
15
- # Install dependencies
16
- RUN pip install --no-cache-dir -r requirements.txt
17
-
18
- # Copy the server code
19
- COPY app.py
20
-
21
- # Create a non-root user for security
22
- RUN useradd -m appuser && chown -R appuser:appuser /app
23
- USER appuser
24
-
25
- # Expose port 8000
26
- EXPOSE 7860
27
 
28
- # Command to run the server
29
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.10
 
2
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
 
5
  COPY requirements.txt .
6
+ RUN pip install -r requirements.txt
7
 
8
+ COPY . .
 
 
 
 
 
 
 
 
 
 
 
9
 
10
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]