|
|
|
FROM python:3.9-slim |
|
|
|
|
|
USER root |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
libtorrent-rasterbar-dev \ |
|
build-essential \ |
|
libssl-dev \ |
|
libboost-system-dev \ |
|
libmagic1 \ |
|
&& 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 . |
|
RUN pip install --no-cache-dir --user --upgrade -r requirements.txt |
|
|
|
|
|
COPY --chown=user . . |
|
|
|
|
|
RUN mkdir -p /app/static && chown user:user /app/static |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |