| FROM python:3.11-slim |
|
|
| |
| ENV PYTHONUNBUFFERED=1 DEBIAN_FRONTEND=noninteractive |
| WORKDIR /app |
|
|
| |
| RUN apt-get update \ |
| && apt-get install -y --no-install-recommends \ |
| git \ |
| curl \ |
| build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt /app/requirements.txt |
| RUN pip install --no-cache-dir -r /app/requirements.txt |
|
|
| |
| COPY . /app |
|
|
| |
| RUN useradd -m appuser || true |
| RUN chown -R appuser:appuser /app |
| USER appuser |
|
|
| |
| EXPOSE 7860 |
| ENV PORT=7860 |
|
|
| |
| |
| CMD ["bash", "-lc", "python -c \"import app; app.demo.launch(server_name='0.0.0.0', server_port=int(__import__('os').environ.get('PORT',7860)))\""] |
|
|