Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Development dockerfile#685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletionsDockerfile.local
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@

FROM ubuntu:jammy
LABEL maintainer="team@postgresml.com"

ARG PG_MAJOR_VER
ENV PG_MAJOR_VER=${PG_MAJOR_VER}

RUN apt-get update
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:apt-fast/stable --yes
RUN apt update && apt-get install -y apt-fast
RUN apt-get update && apt-fast install -y \
libopenblas-dev \
libssl-dev \
bison \
flex \
pkg-config \
cmake \
libreadline-dev \
libz-dev \
curl \
lsb-release \
tzdata \
sudo \
cmake \
libpq-dev \
libclang-dev \
wget \
postgresql-plpython3-$PG_MAJOR_VER \
postgresql-$PG_MAJOR_VER \
postgresql-server-dev-$PG_MAJOR_VER \
git

RUN add-apt-repository ppa:deadsnakes/ppa --yes
RUN apt update && apt-fast install -y \
python3.10 \
python3-pip \
libpython3.10-dev \
python3.10-dev


RUN echo 'postgres ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers


COPY ./pgml-extension/requirements.txt /app/requirements.txt


RUN pip3 install -r /app/requirements.txt


# Running pgrx and tests require a non-root user
WORKDIR /app

RUN chmod a+rwx `$(which pg_config) --pkglibdir` \
`$(which pg_config) --sharedir`/extension \
/var/run/postgresql/

RUN useradd postgresml -m -s /bin/bash -G sudo
RUN echo 'postgresml ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

USER postgresml


# Install cargo and Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/home/postgresml/.cargo/bin:${PATH}"


# Install pgrx
RUN cargo install cargo-pgrx --version "0.8.2" --locked


COPY --chown=postgresml:postgresml ./ /app
RUN sudo chown -R postgresml:postgresml /app
RUN git submodule update --init --recursive




RUN sudo cp /app/pgml-extension/docker/postgresql.conf /etc/postgresql/$PG_MAJOR_VER/main/postgresql.conf
RUN sudo cp /app/pgml-extension/docker/pg_hba.conf /etc/postgresql/$PG_MAJOR_VER/main/pg_hba.conf


# RUN sudo chown -R rust:rust /usr/share/postgresql/$PG_MAJOR_VER/extension
RUN sudo chown -R postgresml:postgresml /usr/share/postgresql/$PG_MAJOR_VER/
RUN sudo chown -R postgresml:postgresml /usr/share/postgresql/$PG_MAJOR_VER/extension

# commenting this three make things work
# USER rust

RUN cd /app/pgml-extension && cargo pgrx init --pg$PG_MAJOR_VER=$(which pg_config)
RUN cd /app/pgml-extension && cargo pgrx install --pg-config $(which pg_config)

EXPOSE 5432

USER postgres

CMD ["/usr/lib/postgresql/14/bin/postgres", "-c", "config_file=/etc/postgresql/14/main/postgresql.conf"]

15 changes: 15 additions & 0 deletionsdocker-compose.local.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
version: "3"
# Run by doing docker compose -f docker-compose.local.yml build --build-arg PG_MAJOR_VER=14
# docker compose -f docker-compose.local.yml up
services:
postgres:
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 1s
timeout: 5s
retries: 100
build:
context: .
dockerfile: Dockerfile.local
ports:
- "5433:5432"
49 changes: 0 additions & 49 deletionspgml-extension/Dockerfile.local
View file
Open in desktop

This file was deleted.


[8]ページ先頭

©2009-2025 Movatter.jp