Commit Graph

21 Commits

Author SHA1 Message Date
Alaister Young
8d4d3b57e0 feat(studio): add tanstack variant to the studio docker image (#48091)
Makes the self-hosted Docker image buildable with the TanStack/Vite
build alongside the existing Next one. The Dockerfile's new
`STUDIO_FRAMEWORK` build arg (default: `next`) selects which framework
lands in the image — the same variable `scripts/dispatch.js` keys on
everywhere else, so `--build-arg STUDIO_FRAMEWORK=tanstack` is the
docker spelling of the existing switch. Both flavors assemble a
normalized `/srv` tree, so a single production stage serves either with
the same CMD (`node apps/studio/server.js`), port 3000, and healthcheck.

Unlike Next's self-contained standalone output, the Vite SSR bundle
externalizes studio's dependencies and resolves them from `node_modules`
at request time, so the tanstack runtime tree is a prod-only `pnpm
deploy` plus the built `dist/`. The boot smoke test runs a second time
against that pruned tree, so a runtime import that's missing from
`dependencies` fails the image build instead of 500ing the deployed
container — which is exactly how this PR caught four packages
misclassified as devDependencies (`braintrust` +
`@smithy/property-provider` via the AI routes, `libpg-query` via the
parse-query API route, `@radix-ui/react-use-escape-keydown` via the
Queues panel; split into its own commit).

**Changed:**
- `apps/studio/Dockerfile`: `ARG STUDIO_FRAMEWORK` selects `build-next`
/ `build-tanstack` stages via `FROM build-${STUDIO_FRAMEWORK}`; both
normalize into one production layout
- `apps/studio/package.json`: moved the four runtime-imported packages
from devDependencies to dependencies (versions unchanged)
- `apps/studio/vite.config.ts`: pinned `preview.host` to `127.0.0.1` —
the prerender step boots `vite preview` and crawls its resolved URL, and
the default `localhost` host lets the server bind the IPv6 loopback
while the crawler fetches `127.0.0.1`, which ECONNREFUSEDs the whole
build inside BuildKit containers
- `.github/workflows/studio-docker-build.yml`: builds the tanstack image
as a second step (reuses the first build's layer cache; job name
unchanged)

**Added:**
- `build:studio:docker:tanstack` root script

Note: the tanstack image is ~2.0GB vs ~1.2GB for Next (externalized
`node_modules`); shrinking it via file tracing is a follow-up. Nothing
self-hosters pull changes until a tanstack-built image is published —
this makes it buildable and CI-checked.

## To test

- `pnpm build:studio:docker` then run the image against a stack —
behavior unchanged (healthcheck `/api/platform/profile` 200, `/` 307s to
`/project/default`)
- `pnpm build:studio:docker:tanstack` then run that image with the same
env — same healthcheck, redirect, and data endpoints (projects, pg-meta)
respond 200; browser loads Project Overview / Table Editor with no
requests leaving the container
- Both verified locally against the CLI stack (`host.docker.internal`
env, container reports `healthy`)
- Vercel + e2e checks on this PR exercise the `preview.host` change on
their runners

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added TanStack-based Studio build support with a framework-selectable
Docker image.
  - Added a local build command for the TanStack Studio Docker image.
- **Build & Deployment**
- Updated the Studio Docker build workflow to also publish a
TanStack-tagged Studio image when relevant.
- **Bug Fixes**
- Improved `vite preview` behavior in containers by binding to IPv4
loopback.
  - Standardized the Studio container runtime port to `3000`.
- **Chores**
  - Updated Studio runtime packages to support the TanStack build.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-07-24 15:32:05 +00:00
Ivan Vasilov
24ce0ba5f8 chore: migrate repo to pnpm v11 (#48033)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Chore / dependency tooling update.

## What is the current behavior?

The repo is pinned to pnpm 10.24.0. Closes
https://linear.app/supabase/issue/FE-3673/migrate-the-repo-to-use-pnpm-v11.

## What is the new behavior?

The repo is pinned to pnpm 11.13.1, pnpm v11 workspace settings are
migrated to `allowBuilds`, and the Studio Dockerfile installs pnpm
11.13.1.

## Additional context

Validated with `CI=true mise exec node@22 -- pnpm install
--frozen-lockfile`, `mise exec node@22 -- pnpm run typecheck`, and `mise
exec node@22 -- pnpm run lint`; full Prettier check still fails on
existing generated docs/router files outside this migration.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated tooling requirements (pnpm **11.13.1**, Node **>=22.13**) and
aligned container build tooling accordingly.
* Adjusted package manager behavior (scoped registry override, update
notifications disabled) and workspace build/engine validation settings.

* **Maintenance**
* Updated `clean` scripts across apps/packages to remove only
build/cache artifacts (no longer delete installed dependencies).
* Reduced Turbo `clean` task output to **errors-only** for cleaner logs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-20 12:57:42 +02:00
Ivan Vasilov
1673012bc7 chore: Bump vulnerable dependencies (#46624)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
  * Updated build tools and development dependencies across the project
  * Upgraded Vue framework and related tooling to latest versions
  * Updated TanStack React Start dependency
* Refined dependency resolution settings to improve build stability and
performance

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-04 12:07:23 +02:00
Ivan Vasilov
30c16da0e1 chore: Split turbo configs for apps into their own files (#44085)
This pull request refactors the Turbo build configuration by moving each
app's build settings from the root `turbo.json` file into their own
dedicated `turbo.jsonc` files within each app's directory. The root
configuration is simplified to only include generic tasks, improving
maintainability and clarity.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
  * Updated Turbo to v2.9.3 to improve build performance and stability.
* Reorganized and added per-app build pipeline configurations to
streamline builds and caching across the workspace.
* Removed a Tailwind container-queries plugin from one app's styling
setup.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-02 15:51:16 +02:00
Gildas Garcia
2773179a5b fix: studio docker build fails because of package patches (#43713)
## Problem

The docker build for studio fails because pnpm patches are not included

## Solution

- bump pnpm version in Dockefile to match the one used by the repo
- bump turbo version in Dockerfile to use one that handles pnpm patches
- add a script to test the build locally
- add a github action to validate the build on each PR
2026-03-12 16:24:07 +01:00
Charis
a46c31f551 chore: set min release age for pnpm (#38787)
* chore: bump pnpm version to 10.16.1

* chore: set min release age for pnpm

* chore: bump pnpm to 10.16.1 in dockerfile
2025-09-17 10:34:33 -04:00
James Parrott
77db22e7c0 Bump node:20-slim to :22-slim in Supabase Studio Dockerfile (#36482)
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2025-06-18 11:28:46 +08:00
Beng Eu
710131456f fix: run next build directly instead of build task to avoid uploading static assets when building image (#33693)
Was broken by #33344, which changed `build` task from `next build` to
`next build && ./../../scripts/upload-static-assets.sh`.
2025-02-19 03:30:45 +00:00
Beng Eu
c2547eec4f fix: hide pnpm update message, it's confusing since the pnpm version is locked; update to pnpm 9.15.4 (#33232) 2025-02-06 14:57:01 +08:00
Ivan Vasilov
6f3c46f5da fix: Change the healthcheck route for docker Studio (#33180)
* Fix the healthcheck for the docker image for studio.

* Various fixes related to the self-hosted environment.
2025-01-30 00:31:52 +01:00
Kevin Grüneberg
71fc66981c chore: bump turbo (#32548) 2025-01-03 21:34:23 +08:00
Ivan Vasilov
dd572efb0d chore: Switch repo to use pnpm (#29928)
* Fix some missing and duplicate dependencies.

* Fix the types for jest in ai-commands package.

* Replace all npm commands with pnpm. Add pnpm files and workspace links.

* Fix rimraf to work with pnpm.

* Refactor the github actions to work with pnpm.

* Delete package-lock.json.

* Fix the tailwind configs to not include node_modules.

* Fix random files.

* Add preinstall scripts to all packages.

* Fix the Dockerfile to work with pnpm.

* Update the DEVELOPERS documentation.
2024-12-20 13:07:20 +01:00
Ivan Vasilov
57197f5c05 fix: Minor fixes for turborepo in Vercel and Docker (#27376)
* Passthrough the sentry env vars to studio so that the sourcemaps are uploaded correctly.

* Fix the Turbo command in the Dockerfile.

* More fixes to the Dockerfile.
2024-06-19 10:31:13 +00:00
Ivan Vasilov
a63731bbf8 chore: Bump turbo to v2 (#27182)
* Bump the version of turbo to 2.0.3.

* Fix the breaking changes in turbo config.

* Make the npm version more loose.

* Fix the build command for the database-design app.

* Try adding some env vars to the turbo for www.

* Add more missing env vars.

* Bump the turbo version to 2.0.4.

* Remove SUPABASE_SERVICE_ROLE_KEY from docs#build since it's used by other scripts, not by build.
2024-06-18 12:32:36 +02:00
Ivan Vasilov
6bf3b8106c chore: Bump turbo (#22563)
* Bump turbo to the latest version.

* Make the turbo version in the dockerfile the same as the repo one.
2024-04-08 10:02:48 +02:00
Kevin Grüneberg
27f9f96ff7 chore: upgrade to node 20 (#22240) 2024-03-26 18:54:22 +07:00
Ivan Vasilov
5b4f27b611 fix: Install python and git when building the Docker image (#21606)
Install python, git and build essentials for both architectures.
2024-02-27 11:32:42 +01:00
Ivan Vasilov
2d8a342922 fix: Another try at fixing the docker build (#21565)
Move the git dependency for both arm and x86 builds. Bump the turbo version to match the repo one.
2024-02-26 13:17:50 -03:30
Ivan Vasilov
49b945e7e5 fix: Various fixes and improvements for the local build (#21560)
* Add git to enable libpg build.

* Fix a copy-paste issue.

* Enable the realtime inspector in local and selfhosted environments.
2024-02-26 15:43:09 +01:00
Ivan Vasilov
64a766a5fb fix: Update the studio dockerfile with the new folder structure (#19179)
* Fix issues caused by moving the studio app.

* Add *.env.* to the dockerignore.
2023-11-23 18:45:22 +01:00
Ivan Vasilov
436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00