|
|
|
FROM python:3.10.12 AS builder |
|
|
|
RUN apt-get update && apt-get install -y \ |
|
docker-ce \ |
|
&& apt-get clean \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN docker builder prune -f |
|
|
|
|
|
FROM python:3.10.12 |
|
|
|
USER root |
|
RUN apt-get update && \ |
|
apt-get install -y \ |
|
libgl1-mesa-glx \ |
|
ffmpeg \ |
|
git \ |
|
git-lfs \ |
|
&& git lfs install && \ |
|
apt-get clean && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH \ |
|
NUMBA_CACHE_DIR=/tmp/numba_cache |
|
|
|
WORKDIR $HOME/app |
|
|
|
COPY --chown=user . $HOME/app |
|
|
|
RUN chmod +x scripts/download_models.sh |
|
RUN bash scripts/download_models.sh |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
RUN ls -la |
|
|
|
|
|
RUN pip install . --verbose |
|
|
|
|
|
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "300", "app_hallo:app"] |
|
|