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.
This commit is contained in:
Ivan Vasilov
2024-06-19 12:31:13 +02:00
committed by GitHub
parent d6f9cb53f9
commit 57197f5c05
2 changed files with 5 additions and 4 deletions

View File

@@ -1,12 +1,12 @@
# To be run in the root of the turbo monorepo
# NOTE: It's highly recommended to use the new builder, Buildkit. https://docs.docker.com/build/buildkit/
## USAGE:
# Build: docker build . -f studio/Dockerfile --target production -t studio:latest
# Build: docker build . -f apps/studio/Dockerfile --target production -t studio:latest
# Run: docker run -p 3000:3000 supabase/studio
# Deploy: docker push supabase/studio:latest
# Clean build:
# docker builder prune
# docker build . -f studio/Dockerfile --target production -t studio:latest --no-cache
# docker build . -f apps/studio/Dockerfile --target production -t studio:latest --no-cache
FROM node:20-slim as base
@@ -27,7 +27,7 @@ WORKDIR /app
FROM base as turbo
COPY . .
RUN npx turbo@2.0.4 prune --scope=studio --docker
RUN npx turbo@2.0.4 prune studio --docker
# Install dev dependencies (only if needed)
FROM base as deps
@@ -47,7 +47,7 @@ CMD ["npm", "run", "dev:studio"]
# Compile Next.js
FROM dev as builder
RUN npx turbo run build --scope=studio --include-dependencies --no-deps
RUN npx turbo@2.0.4 run build --filter studio -- --no-lint
# Copy only compiled code and dependencies
FROM base as production

View File

@@ -51,6 +51,7 @@
"VERCEL_ENV",
"VERCEL_URL"
],
"passThroughEnv": ["SENTRY_ORG", "SENTRY_PROJECT", "SENTRY_AUTH_TOKEN"],
"outputs": [".next/**", "!.next/cache/**"]
},
"www#build": {