dermAI / Dockerfile
Yashvardhan1's picture
Update Dockerfile
d4f29d2 verified
Raw
History Blame Contribute Delete
1.49 kB
FROM python:3.10-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
DEBIAN_FRONTEND=noninteractive \
KMP_DUPLICATE_LIB_OK=TRUE \
API_URL=http://localhost:8000
RUN apt-get update && apt-get install -y --no-install-recommends \
libglib2.0-0 libsm6 libxrender1 libxext6 libgl1 curl supervisor \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
COPY . .
RUN cat > /etc/supervisor/conf.d/dermAI.conf << 'EOF'
[supervisord]
nodaemon=true
logfile=/tmp/supervisord.log
pidfile=/tmp/supervisord.pid
[program:fastapi]
command=uvicorn backend.main:app --host 0.0.0.0 --port 8000 --workers 1
directory=/app/app
environment=PYTHONPATH="/app"
autostart=true
autorestart=true
stdout_logfile=/tmp/fastapi.log
stderr_logfile=/tmp/fastapi_err.log
[program:streamlit]
command=streamlit run Home.py --server.port 7860 --server.address 0.0.0.0 --server.headless true --server.enableCORS false --server.enableXsrfProtection false
directory=/app/app/frontend
environment=PYTHONPATH="/app",API_URL="http://localhost:8000"
autostart=true
autorestart=true
stdout_logfile=/tmp/streamlit.log
stderr_logfile=/tmp/streamlit_err.log
EOF
EXPOSE 7860
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
CMD curl -f http://localhost:7860/_stcore/health || exit 1
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]