Yashvardhan1 commited on
Commit
d4f29d2
·
verified ·
1 Parent(s): 6b2adbd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +43 -12
Dockerfile CHANGED
@@ -1,20 +1,51 @@
1
- FROM python:3.13.5-slim
2
 
3
- WORKDIR /app
 
 
 
 
4
 
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- COPY requirements.txt ./
12
- COPY src/ ./src/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- RUN pip3 install -r requirements.txt
 
 
 
 
 
 
 
 
15
 
16
- EXPOSE 8501
17
 
18
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
19
 
20
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
+ FROM python:3.10-slim
2
 
3
+ ENV PYTHONUNBUFFERED=1 \
4
+ PYTHONDONTWRITEBYTECODE=1 \
5
+ DEBIAN_FRONTEND=noninteractive \
6
+ KMP_DUPLICATE_LIB_OK=TRUE \
7
+ API_URL=http://localhost:8000
8
 
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ libglib2.0-0 libsm6 libxrender1 libxext6 libgl1 curl supervisor \
 
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ WORKDIR /app
14
+
15
+ COPY requirements.txt .
16
+ RUN pip install --no-cache-dir --upgrade pip && \
17
+ pip install --no-cache-dir -r requirements.txt
18
+
19
+ COPY . .
20
+
21
+ RUN cat > /etc/supervisor/conf.d/dermAI.conf << 'EOF'
22
+ [supervisord]
23
+ nodaemon=true
24
+ logfile=/tmp/supervisord.log
25
+ pidfile=/tmp/supervisord.pid
26
+
27
+ [program:fastapi]
28
+ command=uvicorn backend.main:app --host 0.0.0.0 --port 8000 --workers 1
29
+ directory=/app/app
30
+ environment=PYTHONPATH="/app"
31
+ autostart=true
32
+ autorestart=true
33
+ stdout_logfile=/tmp/fastapi.log
34
+ stderr_logfile=/tmp/fastapi_err.log
35
 
36
+ [program:streamlit]
37
+ command=streamlit run Home.py --server.port 7860 --server.address 0.0.0.0 --server.headless true --server.enableCORS false --server.enableXsrfProtection false
38
+ directory=/app/app/frontend
39
+ environment=PYTHONPATH="/app",API_URL="http://localhost:8000"
40
+ autostart=true
41
+ autorestart=true
42
+ stdout_logfile=/tmp/streamlit.log
43
+ stderr_logfile=/tmp/streamlit_err.log
44
+ EOF
45
 
46
+ EXPOSE 7860
47
 
48
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
49
+ CMD curl -f http://localhost:7860/_stcore/health || exit 1
50
 
51
+ CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]