AnesKAM commited on
Commit
68c6891
·
verified ·
1 Parent(s): a501340

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -32
Dockerfile CHANGED
@@ -1,39 +1,10 @@
1
- FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y --no-install-recommends \
7
- curl \
8
- gcc \
9
- && rm -rf /var/lib/apt/lists/*
10
-
11
- # Copy requirements first for better caching
12
  COPY requirements.txt .
 
13
 
14
- # Install Python dependencies
15
- RUN pip install --no-cache-dir -r requirements.txt && \
16
- pip install --no-cache-dir gunicorn
17
-
18
- # Copy application code
19
  COPY . .
20
 
21
- # Create a non-root user
22
- RUN useradd -m appuser && chown -R appuser:appuser /app
23
- USER appuser
24
-
25
- # Expose port
26
- EXPOSE 7680
27
-
28
- # Set environment variables
29
- ENV FLASK_APP=app.py
30
- ENV FLASK_ENV=production
31
- ENV PYTHONUNBUFFERED=1
32
- ENV PORT=7680
33
-
34
- # Healthcheck
35
- HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
36
- CMD curl -f http://localhost:7680/api/health || exit 1
37
-
38
- # Run Flask
39
- CMD ["python", "-m", "flask", "run", "--host=0.0.0.0", "--port=7680"]
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
5
  COPY requirements.txt .
6
+ RUN pip install --no-cache-dir -r requirements.txt
7
 
 
 
 
 
 
8
  COPY . .
9
 
10
+ CMD["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]