From e767f36a2f6dfd182f10fb2f503b7b75eaf0d0f2 Mon Sep 17 00:00:00 2001 From: khorshuheng Date: Wed, 23 Oct 2024 16:36:46 +0800 Subject: [PATCH] fix: allow gotrue service to work without postgres user --- .github/workflows/push_latest_docker.yml | 2 +- docker-compose.yml | 4 ++-- docker/{gotrue.Dockerfile => gotrue/Dockerfile} | 5 +++-- docker/{gotrue.patch => gotrue/patch/mfa_enabled.patch} | 0 4 files changed, 6 insertions(+), 5 deletions(-) rename docker/{gotrue.Dockerfile => gotrue/Dockerfile} (77%) rename docker/{gotrue.patch => gotrue/patch/mfa_enabled.patch} (100%) diff --git a/.github/workflows/push_latest_docker.yml b/.github/workflows/push_latest_docker.yml index 7031cad0c..7f67856b4 100644 --- a/.github/workflows/push_latest_docker.yml +++ b/.github/workflows/push_latest_docker.yml @@ -41,7 +41,7 @@ jobs: - name: Build and Push GoTrue run: | export TAG=${GITHUB_REF#refs/*/} - docker buildx build --platform linux/amd64,linux/arm64 -t appflowyinc/gotrue:${TAG} -t appflowyinc/gotrue:latest -f docker/gotrue.Dockerfile --push . + docker buildx build --platform linux/amd64,linux/arm64 -t appflowyinc/gotrue:${TAG} -t appflowyinc/gotrue:latest -f gotrue/Dockerfile --push docker/gotrue appflowy_cloud_image: runs-on: ubuntu-22.04 diff --git a/docker-compose.yml b/docker-compose.yml index 45306cd78..e3a3c84dc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,8 +43,8 @@ services: gotrue: restart: on-failure build: - context: . - dockerfile: docker/gotrue.Dockerfile + context: docker/gotrue + dockerfile: docker/gotrue/Dockerfile image: appflowyinc/gotrue:${GOTRUE_VERSION:-latest} environment: # There are a lot of options to configure GoTrue. You can reference the example config: diff --git a/docker/gotrue.Dockerfile b/docker/gotrue/Dockerfile similarity index 77% rename from docker/gotrue.Dockerfile rename to docker/gotrue/Dockerfile index d547dce87..41aebd285 100644 --- a/docker/gotrue.Dockerfile +++ b/docker/gotrue/Dockerfile @@ -2,9 +2,10 @@ FROM golang as base WORKDIR /go/src/supabase RUN git clone https://github.com/supabase/auth.git --depth 1 --branch v2.159.1 WORKDIR /go/src/supabase/auth -COPY docker/gotrue.patch . -RUN git apply gotrue.patch +COPY patch/mfa_enabled.patch . +RUN git apply mfa_enabled.patch RUN CGO_ENABLED=0 go build -o /auth . +RUN rm /go/src/supabase/auth/migrations/20240612123726_enable_rls_update_grants.up.sql FROM scratch COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo diff --git a/docker/gotrue.patch b/docker/gotrue/patch/mfa_enabled.patch similarity index 100% rename from docker/gotrue.patch rename to docker/gotrue/patch/mfa_enabled.patch