Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: studio docker build fails because of package patches (#43713)

Gildas Garcia2773179a5ba9
diff --git a/.github/workflows/studio-docker-build.yml b/.github/workflows/studio-docker-build.yml
new file mode 100644
index 00000000000..adca02c7a78
--- /dev/null
+++ b/.github/workflows/studio-docker-build.yml
@@ -0,0 +1,36 @@
+name: Studio Docker Build
+on:
+ push:
+ branches: [master]
+ pull_request:
+
+# Cancel old builds on new commit for same workflow + branch/PR
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: write
+ pull-requests: write
+
+jobs:
+ build:
+ name: 'Studio Docker Build'
+ runs-on: blacksmith-4vcpu-ubuntu-2404
+ steps:
+ - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
+ - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
+ id: filter
+ with:
+ filters: |
+ studio:
+ - 'packages/pg-meta/**'
+ - 'apps/studio/**'
+ - 'apps/ui-library/**'
+ - 'apps/design-system/**'
+ - 'e2e/studio/**'
+ - 'pnpm-lock.yaml'
+ - '.github/workflows/studio-e2e-test.yml'
+ - name: Build
+ if: steps.filter.outputs.studio == 'true'
+ run: docker build . -f apps/studio/Dockerfile --target production -t supabase-studio:local --build-arg NEXT_PUBLIC_STUDIO_AUTH_MODE=supabase --no-cache
diff --git a/apps/studio/Dockerfile b/apps/studio/Dockerfile
index bae1a6b3b1c..707da8a9a1b 100644
--- a/apps/studio/Dockerfile
+++ b/apps/studio/Dockerfile
@@ -17,13 +17,13 @@ ENV PATH="$PNPM_HOME:$PATH"
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
git \
- python3 \
+ python3 \
ca-certificates \
- build-essential && \
+ build-essential && \
rm -rf /var/lib/apt/lists/* && \
update-ca-certificates
-RUN npm install -g [email protected]
+RUN npm install -g [email protected]
WORKDIR /app
@@ -31,12 +31,13 @@ WORKDIR /app
FROM base AS turbo
COPY . .
-RUN pnpm dlx [email protected] prune studio --docker
+RUN pnpm dlx [email protected] prune studio --docker
# Install dev dependencies (only if needed)
FROM base AS deps
COPY --from=turbo /app/out/json ./
COPY --from=turbo /app/out/pnpm-lock.yaml ./
+COPY ./patches/ ./patches
# No need to clean cache because production uses standalone build
RUN pnpm install --frozen-lockfile
diff --git a/package.json b/package.json
index 71e6da0cacd..e302f96d366 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,7 @@
"preinstall": "npx only-allow pnpm",
"build": "turbo run build",
"build:studio": "turbo run build --filter=studio",
+ "build:studio:docker": "docker build . -f apps/studio/Dockerfile --target production -t supabase-studio:local --build-arg NEXT_PUBLIC_STUDIO_AUTH_MODE=supabase --no-cache",
"build:design-system": "turbo run build --filter=design-system",
"build:docs": "turbo run build --filter=docs",
"clean": "turbo run clean --parallel && rimraf -G node_modules/{*,.bin,.modules.yaml}",