-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: admin react-router migration #7922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: preview
Are you sure you want to change the base?
Changes from all commits
0eda662
d9d78c8
559a7cb
5b56cd2
d5871cc
d814898
c1077af
c37b962
106fcda
f502402
1f0d97f
25dd6fd
5d33d9d
4c8e1ad
bd092a5
cb1ae94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,4 +66,4 @@ temp/ | |
| .react-router/ | ||
| build/ | ||
| node_modules/ | ||
| README.md | ||
| README.md | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,5 +102,8 @@ dev-editor | |
| storybook-static | ||
|
|
||
| CLAUDE.md | ||
|
|
||
| build/ | ||
| .react-router/ | ||
| AGENTS.md | ||
| temp/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # React Router - https://github.com/remix-run/react-router-templates/blob/dc79b1a065f59f3bfd840d4ef75cc27689b611e6/default/.dockerignore | ||
| .react-router/ | ||
| build/ | ||
| node_modules/ | ||
| README.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,103 +1,86 @@ | ||
| # syntax=docker/dockerfile:1.7 | ||
| FROM node:22-alpine AS base | ||
|
|
||
| # Setup pnpm package manager with corepack and configure global bin directory for caching | ||
| WORKDIR /app | ||
|
|
||
| ENV TURBO_TELEMETRY_DISABLED=1 | ||
| ENV PNPM_HOME="/pnpm" | ||
| ENV PATH="$PNPM_HOME:$PATH" | ||
| RUN corepack enable | ||
| ENV CI=1 | ||
|
|
||
| RUN corepack enable pnpm | ||
|
|
||
| # =========================================================================== # | ||
|
|
||
| # ***************************************************************************** | ||
| # STAGE 1: Build the project | ||
| # ***************************************************************************** | ||
| FROM base AS builder | ||
| RUN apk add --no-cache libc6-compat | ||
| WORKDIR /app | ||
|
|
||
| ARG TURBO_VERSION=2.5.6 | ||
| RUN corepack enable pnpm && pnpm add -g turbo@${TURBO_VERSION} | ||
| RUN pnpm add -g turbo@2.5.8 | ||
|
|
||
| COPY . . | ||
|
|
||
| # Create a pruned workspace for just the admin app | ||
| RUN turbo prune --scope=admin --docker | ||
|
|
||
| # ***************************************************************************** | ||
| # STAGE 2: Install dependencies & build the project | ||
| # ***************************************************************************** | ||
| FROM base AS installer | ||
|
|
||
| RUN apk add --no-cache libc6-compat | ||
| WORKDIR /app | ||
| # =========================================================================== # | ||
|
|
||
| COPY .gitignore .gitignore | ||
| COPY --from=builder /app/out/json/ . | ||
| COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml | ||
| RUN corepack enable pnpm | ||
| RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm fetch --store-dir=/pnpm/store | ||
| FROM base AS installer | ||
|
|
||
| COPY --from=builder /app/out/full/ . | ||
| COPY turbo.json turbo.json | ||
| RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm install --offline --frozen-lockfile --store-dir=/pnpm/store | ||
| # Build in production mode; we still install dev deps explicitly below | ||
| ENV NODE_ENV=production | ||
|
|
||
| # Public envs required at build time (pick up via process.env) | ||
| ARG NEXT_PUBLIC_API_BASE_URL="" | ||
| ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL | ||
| ARG NEXT_PUBLIC_API_BASE_PATH="/api" | ||
| ENV NEXT_PUBLIC_API_BASE_PATH=$NEXT_PUBLIC_API_BASE_PATH | ||
|
|
||
| ARG NEXT_PUBLIC_ADMIN_BASE_URL="" | ||
| ENV NEXT_PUBLIC_ADMIN_BASE_URL=$NEXT_PUBLIC_ADMIN_BASE_URL | ||
|
|
||
| ARG NEXT_PUBLIC_ADMIN_BASE_PATH="/god-mode" | ||
| ENV NEXT_PUBLIC_ADMIN_BASE_PATH=$NEXT_PUBLIC_ADMIN_BASE_PATH | ||
|
|
||
| ARG NEXT_PUBLIC_SPACE_BASE_URL="" | ||
| ENV NEXT_PUBLIC_SPACE_BASE_URL=$NEXT_PUBLIC_SPACE_BASE_URL | ||
|
|
||
| ARG NEXT_PUBLIC_SPACE_BASE_PATH="/spaces" | ||
| ENV NEXT_PUBLIC_SPACE_BASE_PATH=$NEXT_PUBLIC_SPACE_BASE_PATH | ||
|
|
||
| ARG NEXT_PUBLIC_LIVE_BASE_URL="" | ||
| ENV NEXT_PUBLIC_LIVE_BASE_URL=$NEXT_PUBLIC_LIVE_BASE_URL | ||
| ARG NEXT_PUBLIC_LIVE_BASE_PATH="/live" | ||
| ENV NEXT_PUBLIC_LIVE_BASE_PATH=$NEXT_PUBLIC_LIVE_BASE_PATH | ||
|
|
||
| ARG NEXT_PUBLIC_WEB_BASE_URL="" | ||
| ENV NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL | ||
| ARG NEXT_PUBLIC_WEB_BASE_PATH="" | ||
| ENV NEXT_PUBLIC_WEB_BASE_PATH=$NEXT_PUBLIC_WEB_BASE_PATH | ||
|
|
||
| ENV NEXT_TELEMETRY_DISABLED=1 | ||
| ENV TURBO_TELEMETRY_DISABLED=1 | ||
|
|
||
| RUN pnpm turbo run build --filter=admin | ||
| ARG NEXT_PUBLIC_WEBSITE_URL="https://plane.so" | ||
| ENV NEXT_PUBLIC_WEBSITE_URL=$NEXT_PUBLIC_WEBSITE_URL | ||
| ARG NEXT_PUBLIC_SUPPORT_EMAIL="[email protected]" | ||
| ENV NEXT_PUBLIC_SUPPORT_EMAIL=$NEXT_PUBLIC_SUPPORT_EMAIL | ||
|
|
||
| # ***************************************************************************** | ||
| # STAGE 3: Copy the project and start it | ||
| # ***************************************************************************** | ||
| FROM base AS runner | ||
| WORKDIR /app | ||
|
|
||
| # Don't run production as root | ||
| RUN addgroup --system --gid 1001 nodejs | ||
| RUN adduser --system --uid 1001 nextjs | ||
| USER nextjs | ||
|
|
||
| # Automatically leverage output traces to reduce image size | ||
| # https://nextjs.org/docs/advanced-features/output-file-tracing | ||
| COPY --from=installer /app/apps/admin/.next/standalone ./ | ||
| COPY --from=installer /app/apps/admin/.next/static ./apps/admin/.next/static | ||
| COPY --from=installer /app/apps/admin/public ./apps/admin/public | ||
|
|
||
| ARG NEXT_PUBLIC_API_BASE_URL="" | ||
| ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL | ||
|
|
||
| ARG NEXT_PUBLIC_ADMIN_BASE_URL="" | ||
| ENV NEXT_PUBLIC_ADMIN_BASE_URL=$NEXT_PUBLIC_ADMIN_BASE_URL | ||
| COPY .gitignore .gitignore | ||
| COPY --from=builder /app/out/json/ . | ||
| COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml | ||
|
|
||
| ARG NEXT_PUBLIC_ADMIN_BASE_PATH="/god-mode" | ||
| ENV NEXT_PUBLIC_ADMIN_BASE_PATH=$NEXT_PUBLIC_ADMIN_BASE_PATH | ||
| # Fetch dependencies to cache store, then install offline with dev deps | ||
| RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm fetch --store-dir=/pnpm/store | ||
| COPY --from=builder /app/out/full/ . | ||
| COPY turbo.json turbo.json | ||
| RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm install --offline --frozen-lockfile --store-dir=/pnpm/store --prod=false | ||
|
|
||
| ARG NEXT_PUBLIC_SPACE_BASE_URL="" | ||
| ENV NEXT_PUBLIC_SPACE_BASE_URL=$NEXT_PUBLIC_SPACE_BASE_URL | ||
| # Build only the admin package | ||
| RUN pnpm turbo run build --filter=admin | ||
|
|
||
| ARG NEXT_PUBLIC_SPACE_BASE_PATH="/spaces" | ||
| ENV NEXT_PUBLIC_SPACE_BASE_PATH=$NEXT_PUBLIC_SPACE_BASE_PATH | ||
| # =========================================================================== # | ||
|
|
||
| ARG NEXT_PUBLIC_WEB_BASE_URL="" | ||
| ENV NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL | ||
| FROM nginx:1.27-alpine AS production | ||
|
|
||
| ENV NEXT_TELEMETRY_DISABLED=1 | ||
| ENV TURBO_TELEMETRY_DISABLED=1 | ||
| COPY apps/admin/nginx/nginx.conf /etc/nginx/nginx.conf | ||
| COPY --from=installer /app/apps/admin/build/client /usr/share/nginx/html/god-mode | ||
|
|
||
| EXPOSE 3000 | ||
|
|
||
| CMD ["node", "apps/admin/server.js"] | ||
| HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ | ||
| CMD curl -fsS http://127.0.0.1:3000/ >/dev/null || exit 1 | ||
|
Comment on lines
+83
to
+84
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Install curl before using it in the healthcheck.
FROM nginx:1.27-alpine AS production
+
+RUN apk add --no-cache curl🤖 Prompt for AI Agents |
||
|
|
||
| CMD ["nginx", "-g", "daemon off;"] | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sriramveeraghanta we should probably make an ESLint for react-router, but I figure we can do a fast follow.