Skip to content

The open alternative to Salesforce, designed for AI.

Add new Dockerfile for postgres (#2313)

martmull5becefadcb28
diff --git a/infra/build/postgres/Dockerfile b/infra/build/postgres/Dockerfile
index 38560b3d74d..e574f2d5fb2 100644
--- a/infra/build/postgres/Dockerfile
+++ b/infra/build/postgres/Dockerfile
@@ -1,11 +1,13 @@
-ARG PG_MAIN_VERSION=14
+ARG IMAGE_TAG='15.4.0-debian-11-r45'
-FROM postgres:${PG_MAIN_VERSION} as postgres
+FROM bitnami/postgresql:${IMAGE_TAG}
-ARG PG_MAIN_VERSION
+ARG PG_MAIN_VERSION=15
ARG PG_GRAPHQL_VERSION=1.3.0
ARG TARGETARCH
+USER root
+
RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
@@ -27,4 +29,8 @@ RUN apt update && apt install -y curl
RUN curl -L "https://github.com/supabase/pg_graphql/releases/download/v${PG_GRAPHQL_VERSION}/pg_graphql-v${PG_GRAPHQL_VERSION}-pg${PG_MAIN_VERSION}-${TARGETARCH}-linux-gnu.deb" -o pg_graphql.deb
RUN dpkg --install pg_graphql.deb
-COPY ./infra/build/postgres/init.sql /docker-entrypoint-initdb.d/
\ No newline at end of file
+COPY ./infra/build/postgres/init.sql /docker-entrypoint-initdb.d/
+
+USER 1001
+ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/entrypoint.sh" ]
+CMD [ "/opt/bitnami/scripts/postgresql/run.sh" ]
\ No newline at end of file
diff --git a/infra/release/build-postgres.sh b/infra/release/build-postgres.sh
new file mode 100755
index 00000000000..57159e631ac
--- /dev/null
+++ b/infra/release/build-postgres.sh
@@ -0,0 +1,6 @@
+
+docker buildx build \
+--push \
+--no-cache \
+--platform linux/amd64,linux/arm64 \
+-f ./infra/build/postgres/Dockerfile -t twentycrm/twenty-postgres:0.2.0 -t twentycrm/twenty-postgres:latest .