| |
| FROM python:3.9 |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| libgl1-mesa-glx \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN useradd -m -u 1000 user |
|
|
| |
| USER user |
|
|
| |
| ENV PATH="/home/user/.local/bin:$PATH" |
|
|
| |
| WORKDIR /app |
|
|
| |
| COPY --chown=user ./requirements.txt /app/requirements.txt |
| RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt |
|
|
| |
| COPY --chown=user . /app |
|
|
| |
| RUN mkdir -p /app/static/uploads /app/static/results && \ |
| chmod -R 755 /app/static/uploads /app/static/results |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|