FROM python:3.10-slim WORKDIR /app COPY requirements.txt . RUN pip install -U pip wheel && pip install -r requirements.txt COPY . . ENV PORT=7860 EXPOSE 7860 # Use sh -c so $PORT expands; falls back to 7860 if not set CMD ["sh","-c","gunicorn -w 2 -k gthread -b 0.0.0.0:${PORT:-7860} app:app"]