-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.serverless
38 lines (26 loc) · 1.05 KB
/
Dockerfile.serverless
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ARG POETRY_VERSION=1.6.1
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
# Allow statements and log messages to immediately appear in the logs
ENV PYTHONUNBUFFERED True
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y tzdata
# ENV TZ Asia/Tokyo
RUN apt-get update && \
apt-get install --yes --no-install-recommends curl g++ libopencv-dev python3.10 python3-pip && \
rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | POETRY_VERSION=${POETRY_VERSION} python3.10 -
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY pyproject.toml poetry.lock ./
ENV PATH="/root/.local/bin:$PATH"
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-root && \
rm -rf /root/.cache/pypoetry && \
rm -rf /root/.cache/pip
#use paddlegpu
RUN pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
RUN pip install runpod
COPY . ./
COPY magic-pdf.gpu.json /root/magic-pdf.json
RUN python3.10 download_models.py
CMD ["sh", "-c", "ls && python3.10 serverless.py"]