Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🚀 Remove corepack dependency from docker image (#2181)
Luke Vella7e005b92cd10
diff --git a/.env.development b/.env.developmentindex 14fb5c81d..90d0e02ab 100644--- a/.env.development+++ b/.env.development@@ -5,9 +5,6 @@ SECRET_PASSWORD=abcdef1234567890abcdef1234567890# Example: https://example.comNEXT_PUBLIC_BASE_URL=http://localhost:3000-# AUTH_URL should be the same as NEXT_PUBLIC_BASE_URL-AUTH_URL=http://localhost:3000-# A connection string to your Postgres databaseDATABASE_URL="postgres://postgres:postgres@localhost:5450/rallly"diff --git a/apps/web/.env.test b/apps/web/.env.testindex 6ca49f474..8112015e0 100644--- a/apps/web/.env.test+++ b/apps/web/.env.test@@ -1,7 +1,6 @@NODE_ENV=testPORT=3002NEXT_PUBLIC_BASE_URL=http://localhost:3002-AUTH_URL=$NEXT_PUBLIC_BASE_URLSECRET_PASSWORD=abcdef1234567890abcdef1234567890DATABASE_URL=postgres://postgres:postgres@localhost:5450/ralllydiff --git a/apps/web/Dockerfile b/apps/web/Dockerfileindex 8b7680c53..6421d43d4 100644--- a/apps/web/Dockerfile+++ b/apps/web/Dockerfile@@ -1,14 +1,11 @@-# Base stage with Node.js 24 and Corepack enabledFROM node:24 AS baseENV PNPM_HOME="/pnpm"ENV PATH="$PNPM_HOME:$PATH"RUN corepack enable-# Slim base stage with Node.js 24 and Corepack enabledFROM node:24-slim AS base-slimENV PNPM_HOME="/pnpm"ENV PATH="$PNPM_HOME:$PATH"-RUN corepack enable# --- Builder Stage ---FROM base AS builder@@ -57,43 +54,34 @@ RUN apt-get update \WORKDIR /app-# Install prisma globally needed for runtime operations like migrations-RUN pnpm add -g prisma@7-# Don't run production as rootRUN addgroup --system nodejs \&& adduser --system --ingroup nodejs --home /app --shell /bin/bash nextjs-# Copy Corepack cache from installer stage to avoid runtime download-COPY --chown=nextjs:nodejs --from=installer /root/.cache/node/corepack/ /app/.cache/node/corepack/+# Install prisma for runtime migrations (must be resolvable from /app)+RUN npm add prisma@7-# Copy app files+# Copy prisma schema and config for migrationsCOPY --from=builder /app/scripts/docker-start.sh ./COPY --from=builder /app/packages/database/prisma ./prismaCOPY --from=builder /app/packages/database/prisma.config.ts ./-COPY --from=installer /app/apps/web/next.config.ts .-COPY --from=installer /app/apps/web/package.json .# Copy Next.js standalone outputCOPY --chown=nextjs:nodejs --from=installer /app/apps/web/.next/standalone ./COPY --chown=nextjs:nodejs --from=installer /app/apps/web/.next/static ./apps/web/.next/staticCOPY --chown=nextjs:nodejs --from=installer /app/apps/web/public ./apps/web/public-# Fix ownership of global pnpm dir - Prisma needs write access to its engines-# and cache directories within the pnpm global store at runtime-RUN chown -R nextjs:nodejs /pnpm-ENV HOME=/appUSER nextjs-EXPOSE 3000+ENV HOME=/appENV PORT=3000+ENV HOSTNAME=0.0.0.0+ENV LOG_LEVEL=warnARG SELF_HOSTEDENV NEXT_PUBLIC_SELF_HOSTED=$SELF_HOSTED-ENV HOSTNAME=0.0.0.0-# Set default log level to warning-ENV LOG_LEVEL=warn+EXPOSE 3000HEALTHCHECK CMD curl --fail http://localhost:${PORT}/api/status || exit 1diff --git a/packages/database/package.json b/packages/database/package.jsonindex 5e2d31aa7..292e99682 100644--- a/packages/database/package.json+++ b/packages/database/package.json@@ -7,6 +7,7 @@"db:push": "prisma db push --skip-generate","db:deploy": "prisma migrate deploy","db:migrate": "prisma migrate dev --skip-generate",+ "db:reset": "prisma migrate reset","db:seed": "tsx prisma/seed.ts","type-check": "tsc --pretty --noEmit"},@@ -18,7 +19,6 @@"@prisma/client": "^7.3.0","@vercel/functions": "^3.3.6","dayjs": "^1.11.13",- "dotenv": "^17.2.4","pg": "^8.17.1"},"devDependencies": {diff --git a/packages/database/prisma.config.ts b/packages/database/prisma.config.tsindex 0cead7fa4..144a2bd00 100644--- a/packages/database/prisma.config.ts+++ b/packages/database/prisma.config.ts@@ -1,9 +1,11 @@import path from "node:path";-import dotenv from "dotenv";import { defineConfig } from "prisma/config";-// Load .env from monorepo root-dotenv.config({ path: path.join(__dirname, "../../.env") });+try {+ process.loadEnvFile(path.join(__dirname, "../../.env"));+} catch {+ console.info("No .env file found, continuing without it");+}export default defineConfig({schema: path.join(__dirname, "prisma"),diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 603283b60..4a9118244 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -83,7 +83,7 @@ importers:version: 8.1.0([email protected])'@vercel/analytics':specifier: ^1.5.0- version: 1.6.1([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])+ version: 1.6.1([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])dayjs:specifier: ^1.11.13version: 1.11.19@@ -122,7 +122,7 @@ importers:version: 5.0.0(@types/[email protected])([email protected])next-seo:specifier: ^6.1.0- version: 6.8.0([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ version: 6.8.0([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])pg:specifier: ^8.17.1version: 8.18.0@@ -552,9 +552,6 @@ importers:dayjs:specifier: ^1.11.13version: 1.11.19- dotenv:- specifier: ^17.2.4- version: 17.2.4pg:specifier: ^8.17.1version: 8.18.0@@ -15967,7 +15964,7 @@ snapshots:dependencies:uncrypto: 0.1.3- '@vercel/[email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])':+ '@vercel/[email protected]([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])':optionalDependencies:next: 16.1.6(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])react: 19.2.4@@ -19698,7 +19695,7 @@ snapshots:react: 19.2.4react-dom: 19.2.4([email protected])- [email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):+ [email protected]([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):dependencies:next: 16.1.6(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])react: 19.2.4diff --git a/scripts/docker-start.sh b/scripts/docker-start.shindex 4a60c1bd2..c2f232ee2 100755--- a/scripts/docker-start.sh+++ b/scripts/docker-start.sh@@ -1,8 +1,8 @@#!/bin/shset -e-export DIRECT_DATABASE_URL=$DATABASE_URL+# Needed by next-auth to verify the origin of the requestexport AUTH_URL=$NEXT_PUBLIC_BASE_URL-pnpm prisma migrate deploy --config=./prisma.config.ts+npx prisma migrate deploy --config=./prisma.config.tsnode apps/web/server.js