Aliashraf commited on
Commit
aa026da
·
verified ·
1 Parent(s): 5f5bda2

Update dockerfile

Browse files
Files changed (1) hide show
  1. dockerfile +5 -4
dockerfile CHANGED
@@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y \
5
  build-essential \
6
  libffi-dev \
7
  libssl-dev \
 
8
  && apt-get clean \
9
  && rm -rf /var/lib/apt/lists/*
10
 
@@ -20,9 +21,9 @@ COPY app.py .
20
  # Expose port 8000
21
  EXPOSE 8000
22
 
23
- # Health check to ensure the app is running
24
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
25
  CMD curl -f http://localhost:8000/health || exit 1
26
 
27
- # Run gunicorn with FastAPI
28
- CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "app:app", "--bind", "0.0.0.0:8000", "--log-level", "info", "--timeout", "120"]
 
5
  build-essential \
6
  libffi-dev \
7
  libssl-dev \
8
+ curl \
9
  && apt-get clean \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
21
  # Expose port 8000
22
  EXPOSE 8000
23
 
24
+ # Health check with increased timeout and start period
25
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
26
  CMD curl -f http://localhost:8000/health || exit 1
27
 
28
+ # Run gunicorn with FastAPI, simplified command
29
+ CMD ["gunicorn", "-k", "uvicorn.workers.UvicornWorker", "app:app", "--bind", "0.0.0.0:8000", "--workers", "2", "--timeout", "120", "--log-level", "info"]