mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-06 22:03:59 -05:00
## 🧢 Overview This PR migrates the AutoGPT Platform frontend from [yarn 1](https://classic.yarnpkg.com/lang/en/) to [pnpm](https://pnpm.io/) using **corepack** for automatic package manager management. **yarn1** is not longer maintained and a bit old, moving to **pnpm** we get: - ⚡ Significantly faster install times, - 💾 Better disk space efficiency, - 🛠️ Better community support and maintenance, - 💆🏽♂️ Config swap very easy ## 🏗️ Changes ### Package Management Migration - updated [corepack](https://github.com/nodejs/corepack) to use [pnpm](https://pnpm.io/) - Deleted `yarn.lock` and generated new `pnpm-lock.yaml` - Updated `.gitignore` ### Documentation Updates - `frontend/README.md`: - added comprehensive tech stack overview with links - updated all commands to use pnpm - added corepack setup instructions - and included migration disclaimer for yarn users - `backend/README.md`: - Updated installation instructions to use pnpm with corepack - `AGENTS.md`: - Updated testing commands from yarn to pnpm ### CI/CD & Infrastructure - **GitHub Workflows** : - updated all jobs to use pnpm with corepack enable - cleaned FE Playwright test workflow to avoid Sentry noise - **Dockerfile**: - updated to use pnpm with corepack, changed lock file reference, and updated cache mount path ### 📋 Checklist #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: **Test Plan:** > assuming you are on the `frontend` folder - [x] Clean installation works: `rm -rf node_modules && corepack enable && pnpm install` - [x] Development server starts correctly: `pnpm dev` - [x] Build process works: `pnpm build` - [x] Linting and formatting work: `pnpm lint` and `pnpm format` - [x] Type checking works: `pnpm type-check` - [x] Tests run successfully: `pnpm test` - [x] Storybook starts correctly: `pnpm storybook` - [x] Docker build succeeds with new pnpm configuration - [x] GitHub Actions workflow passes with pnpm commands #### For configuration changes: - [x] `.env.example` is updated or already compatible with my changes - [x] `docker-compose.yml` is updated or already compatible with my changes - [x] I have included a list of my configuration changes in the PR description (under **Changes**)
43 lines
1.1 KiB
Docker
43 lines
1.1 KiB
Docker
# Base stage for both dev and prod
|
|
FROM node:21-alpine AS base
|
|
WORKDIR /app
|
|
RUN corepack enable
|
|
COPY autogpt_platform/frontend/package.json autogpt_platform/frontend/pnpm-lock.yaml ./
|
|
RUN --mount=type=cache,target=/root/.local/share/pnpm pnpm install --frozen-lockfile
|
|
|
|
# Dev stage
|
|
FROM base AS dev
|
|
ENV NODE_ENV=development
|
|
ENV HOSTNAME=0.0.0.0
|
|
COPY autogpt_platform/frontend/ .
|
|
EXPOSE 3000
|
|
CMD ["pnpm", "run", "dev", "--hostname", "0.0.0.0"]
|
|
|
|
# Build stage for prod
|
|
FROM base AS build
|
|
COPY autogpt_platform/frontend/ .
|
|
ENV SKIP_STORYBOOK_TESTS=true
|
|
RUN pnpm build
|
|
|
|
# Prod stage - based on NextJS reference Dockerfile https://github.com/vercel/next.js/blob/64271354533ed16da51be5dce85f0dbd15f17517/examples/with-docker/Dockerfile
|
|
FROM node:21-alpine AS prod
|
|
ENV NODE_ENV=production
|
|
ENV HOSTNAME=0.0.0.0
|
|
WORKDIR /app
|
|
|
|
RUN addgroup --system --gid 1001 nodejs
|
|
RUN adduser --system --uid 1001 nextjs
|
|
|
|
RUN mkdir .next
|
|
RUN chown nextjs:nodejs .next
|
|
|
|
COPY --from=build --chown=nextjs:nodejs /app/.next/standalone ./
|
|
COPY --from=build --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
|
|
COPY --from=build /app/public ./public
|
|
|
|
USER nextjs
|
|
|
|
EXPOSE 3000
|
|
CMD ["node", "server.js"]
|