Skip to content

Commit 126c11c

Browse files
committed
Back to modelw dockerfile
1 parent dc59424 commit 126c11c

1 file changed

Lines changed: 4 additions & 110 deletions

File tree

back/Dockerfile

Lines changed: 4 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,11 @@
1-
FROM python:3.13.7-slim
1+
FROM modelw/base:2025.07
22

3-
ARG MODEL_W_PIP_EXTRA=""
3+
COPY --chown=user pyproject.toml poetry.lock ./
44

5-
RUN python -m venv /opt/model-w \
6-
&& /opt/model-w/bin/python -m pip install --no-cache-dir $MODEL_W_PIP_EXTRA 'modelw-docker[health]==2025.7.0' \
7-
&& ln -s /opt/model-w/bin/modelw-docker /usr/local/bin/modelw-docker
8-
9-
RUN mkdir /code \
10-
&& useradd -d /code -s /bin/bash user \
11-
&& chown -R user:user /code
12-
13-
COPY --chown=user model-w.toml pyproject.toml poetry.lock README.md ./
14-
15-
# For PDF parsing
16-
# RUN apt-get install -y tesseract-ocr tesseract-ocr-spa tesseract-ocr-fra
17-
18-
ENV DEBIAN_FRONTEND=noninteractive
19-
20-
RUN apt-get update \
21-
&& apt-get install -y curl ca-certificates gnupg apt-transport-https lsb-release \
22-
&& curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor --output /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg \
23-
&& curl https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor --output /etc/apt/trusted.gpg.d/nodesource.gpg
24-
25-
COPY ./sources.list /etc/apt/sources.list
26-
27-
RUN apt-get update \
28-
&& apt-get install -y \
29-
# Common project dependencies
30-
libpcre3 \
31-
libpcre3-dev \
32-
mime-support \
33-
postgresql-client \
34-
libpq-dev \
35-
gdal-bin \
36-
gdal-data \
37-
# Things required to build Python
38-
build-essential \
39-
gcc \
40-
g++ \
41-
make \
42-
libssl-dev \
43-
zlib1g-dev \
44-
libbz2-dev \
45-
libreadline-dev \
46-
libsqlite3-dev \
47-
llvm \
48-
libncursesw5-dev \
49-
xz-utils \
50-
tk-dev \
51-
libxml2-dev \
52-
libxmlsec1-dev \
53-
libffi-dev \
54-
liblzma-dev \
55-
# Things required to build Pillow
56-
libtiff5-dev \
57-
libjpeg-dev \
58-
libopenjp2-7-dev \
59-
zlib1g-dev \
60-
libfreetype6-dev \
61-
liblcms2-dev \
62-
libwebp-dev \
63-
tcl8.6-dev \
64-
tk8.6-dev \
65-
libharfbuzz-dev \
66-
libfribidi-dev \
67-
libxcb1-dev \
68-
python3-dev \
69-
# NodeJS
70-
nodejs \
71-
# Things required to use Weasyprint
72-
libpango-1.0-0 \
73-
libpangoft2-1.0-0 \
74-
# Stuff for unstructured pdf parsing
75-
poppler-utils \
76-
# Stuff to allow configuration afterwards
77-
sudo \
78-
&& apt-get upgrade -y \
79-
&& rm -fr \
80-
/var/log/alternatives.log \
81-
/var/log/apt/history.log \
82-
/var/log/apt/term.log \
83-
/var/log/bootstrap.log \
84-
/var/log/dpkg.log \
85-
/var/cache/man \
86-
/var/cache/ldconfig/aux-cache \
87-
/etc/machine-id \
88-
/var/cache/apt
89-
90-
RUN echo "user ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/model-w \
91-
&& chmod 0440 /etc/sudoers.d/model-w
92-
93-
RUN curl -sSL https://install.python-poetry.org | env POETRY_HOME=/opt/poetry python3 - \
94-
&& ln -s /opt/poetry/bin/poetry /usr/local/bin/poetry
95-
96-
RUN modelw-docker install \
97-
&& modelw-docker run poetry run playwright install-deps \
98-
&& modelw-docker run poetry run playwright install firefox \
99-
&& poetry run pip uninstall -y effdet
5+
RUN modelw-docker install
1006

1017
COPY --chown=user . .
1028

1039
RUN modelw-docker build
10410

105-
106-
# For installing chat-rag full for back based images with all the AI functionality and libraries.
107-
# docker build --build-arg INSTALL_CHAT_RAG=true .
108-
ARG INSTALL_CHAT_RAG
109-
ENV INSTALL_CHAT_RAG=$INSTALL_CHAT_RAG
110-
111-
RUN if [ "$INSTALL_CHAT_RAG" = "true" ]; then echo "Installing nvidia-cudnn-cu12..."; pip install nvidia-cudnn-cu12==8.9.2.26; fi
112-
RUN if [ "$INSTALL_CHAT_RAG" = "true" ]; then echo "Installing chat-rag..."; poetry run pip install chat-rag[full]==0.2.5; fi
113-
RUN if [ "$INSTALL_CHAT_RAG" = "true" ]; then echo "Installing ninja-build..."; apt-get install ninja-build; fi
114-
115-
ENV RAY_task_events_max_num_task_in_gcs=100
116-
117-
CMD ./starter_script.sh
11+
CMD ["modelw-docker", "serve"]

0 commit comments

Comments
 (0)