-
Notifications
You must be signed in to change notification settings - Fork 45
/
Dockerfile_gpu
37 lines (27 loc) · 950 Bytes
/
Dockerfile_gpu
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
FROM python:3.11 AS builder
RUN pip3 install poetry
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
WORKDIR /app
COPY . .
RUN mv pyproject_gpu.toml pyproject.toml \
&& rm poetry.lock \
&& mv magic-pdf.gpu.template.json magic-pdf.template.json
RUN poetry install && rm -rf $POETRY_CACHE_DIR
RUN poetry run aliyun-bootstrap -a install
FROM python:3.11-slim AS prod
RUN rm -rf /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Harbin /etc/localtime
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH" \
ENABLE_FASTAPI=false \
ENABLE_REQUESTS=false \
ENABLE_AIOHTTPCLIENT=false \
ENABLE_HTTPX=false
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 curl
WORKDIR /app
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY . .
RUN mv magic-pdf.gpu.template.json magic-pdf.template.json
CMD ["pai_rag serve"]