Add new Dockerfile for postgres (#2313)

* Add new Dockerfile for postgres

* Fix docker

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
martmull
2023-11-02 14:21:06 +01:00
committed by GitHub
parent 4d89e093d6
commit 5becefadcb
2 changed files with 16 additions and 4 deletions

View File

@ -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/
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" ]

View File

@ -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 .