11FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
22LABEL maintainer="team@postgresml.com"
33
4- RUN apt-get update
54ARG DEBIAN_FRONTEND=noninteractive
5+ ARG PGML_VERSION=2.5.2
66ENV TZ=Etc/UTC
77ENV PATH="/usr/local/cuda/bin:${PATH}"
88
9- RUN apt-get update && apt-get install -y curl lsb-release python3 python3-pip tzdata sudo cmake libpq-dev libclang-dev wget git
10-
9+ # Dependencies
1110RUN apt-get update && \
12- apt-get install -y wget gnupg lsb-release && \
13- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
11+ apt-get install -y \
12+ curl \
13+ lsb-release \
14+ python3 \
15+ python3-pip \
16+ tzdata \
17+ sudo \
18+ cmake \
19+ libpq-dev \
20+ libclang-dev \
21+ wget \
22+ git \
23+ gnupg \
24+ lsb-release
25+
26+ # PostgreSQL
27+ RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
1428 echo"deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
1529 apt-get update && \
1630 apt-get install -y postgresql-14 && \
1731 apt-get install -y postgresql-plpython3-14
1832
19-
33+ # PostgresML
2034RUN echo"deb [trusted=yes] https://apt.postgresml.org $(lsb_release -cs) main" >> /etc/apt/sources.list
2135RUN cat /etc/apt/sources.list
22- RUN apt-get update && apt-get install -y postgresql-pgml-14
23- # Cache this, quicker
24- COPY --chown=postgres:postgres. /app
36+ RUN apt-get update && apt-get install -y postgresql-pgml-14=${PGML_VERSION}
37+
38+ COPY --chown=postgres:postgresrequirements.txt /app/requirements.txt
2539WORKDIR /app
2640RUN pip3 install -r requirements.txt
41+
42+ COPY --chown=postgres:postgres requirements-xformers.txt /app/requirements-xformers.txt
2743RUN pip3 install -r requirements-xformers.txt --no-dependencies
2844
45+ COPY --chown=postgres:postgres . /app
2946# Listen on 0.0.0.0 and allow 'root' to connect without a password.
3047# Please modify for production deployments accordingly.
3148RUN cp /app/docker/postgresql.conf /etc/postgresql/14/main/postgresql.conf
@@ -36,5 +53,4 @@ RUN cd /tmp && \
3653 make && \
3754 make install
3855
39- WORKDIR /app
4056ENTRYPOINT ["/bin/bash" ,"/app/docker/entrypoint.sh" ]