Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/fe-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
version: 10

- name: Set .env file
working-directory: ./frontend
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fe-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
version: 10

- name: Set .env file
run: |
Expand Down
28 changes: 28 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:20-slim AS base
WORKDIR /app
RUN corepack enable pnpm && corepack install -g pnpm@latest-10

FROM base AS builder
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages ./packages
COPY configs ./configs
COPY apps ./apps

RUN pnpm fetch -r
COPY . ./
RUN pnpm install -r
RUN pnpm build

RUN pnpm --filter @endolphin/server --prod deploy ./build/server
COPY ./apps/client/dist ./build/client
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Invalid deploy target for @endolphin/server.

There’s no deploy script in frontend/apps/server/package.json, so this command will fail. Did you mean:

pnpm --filter @endolphin/server run build

or another custom script?

🤖 Prompt for AI Agents
In frontend/Dockerfile at lines 16-17, the RUN command uses an invalid `deploy`
script for @endolphin/server, which does not exist in its package.json. Replace
`pnpm --filter @endolphin/server --prod deploy ./build/server` with a valid
script such as `pnpm --filter @endolphin/server run build` or another existing
custom script defined in the package.json to ensure the command succeeds.


FROM base AS stage
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/build/client ./client
COPY --from=builder /app/build/server/dist ./server
COPY --from=builder /app/build/server/package.json ./server/package.json
COPY --from=builder /app/build/server/node_modules ./server/node_modules

EXPOSE 5173
ENV NODE_ENV=production
CMD ["pnpm", "start"]
Comment on lines +20 to +28
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Final stage missing runtime dependencies and incorrect entrypoint.

You only copy server’s node_modules and the root package.json, but don’t install production dependencies for the root or client. Moreover, CMD ["pnpm","start"] relies on workspace scripts that aren’t available here. Either:

  • Copy and install all production deps in this stage, or
  • Change CMD to directly run your server (e.g., node server/index.js) and serve static assets.

Without this, the container will error on startup.

🤖 Prompt for AI Agents
In frontend/Dockerfile lines 20 to 28, the final stage only copies server
node_modules and package.json but does not install production dependencies for
the root or client, and the CMD uses "pnpm start" which depends on workspace
scripts not present in the container. To fix this, either copy and install all
necessary production dependencies in this stage or change the CMD to directly
run the server entry point (e.g., "node server/index.js") and serve static
assets, ensuring the container has all runtime dependencies and a valid startup
command.

2 changes: 1 addition & 1 deletion frontend/apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "pnpm --filter server start",
"dev": "pnpm --filter server dev",
"build": "vite build && tsc -b",
"test": "vitest",
"lint": "eslint .",
Expand Down
3 changes: 2 additions & 1 deletion frontend/apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"type": "module",
"scripts": {
"build": "cross-env NODE_ENV=build tsup",
"start": "cross-env NODE_ENV=start tsup --watch"
"dev": "cross-env NODE_ENV=start tsup --watch",
"start": "node index.js"
Comment on lines +9 to +10
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing cross-env dependency and non-standard NODE_ENV values.

You reference cross-env in both scripts but haven’t installed it—CI/build will break. Also, setting NODE_ENV=start is unconventional; use development for dev and production for start.

Apply this diff:

 "scripts": {
-  "dev": "cross-env NODE_ENV=start tsup --watch",
+  "dev": "cross-env NODE_ENV=development tsup --watch",
-  "start": "node index.js"
+  "start": "cross-env NODE_ENV=production node index.js"
 },
 "devDependencies": {
+  "cross-env": "^7.0.3",
   "@types/express": "^5.0.2",
   "typescript": "^5.6.2",
   "@endolphin/tsup-config": "workspace:^",
   "@endolphin/vitest-config": "workspace:^"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dev": "cross-env NODE_ENV=start tsup --watch",
"start": "node index.js"
"scripts": {
- "dev": "cross-env NODE_ENV=start tsup --watch",
+ "dev": "cross-env NODE_ENV=development tsup --watch",
- "start": "node index.js"
+ "start": "cross-env NODE_ENV=production node index.js"
},
"devDependencies": {
+ "cross-env": "^7.0.3",
"@types/express": "^5.0.2",
"typescript": "^5.6.2",
"@endolphin/tsup-config": "workspace:^",
"@endolphin/vitest-config": "workspace:^"
}
🤖 Prompt for AI Agents
In frontend/apps/server/package.json around lines 9 to 10, the scripts use
cross-env without it being listed as a dependency, which will cause build
failures. Add cross-env to the devDependencies in package.json. Also, change the
NODE_ENV value in the "dev" script from "start" to "development" and in the
"start" script from the default to "production" to follow standard environment
naming conventions.

},
"dependencies": {
"express": "^5.1.0"
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "pnpm -r start",
"build": "pnpm -r build",
"dev": "pnpm -r dev",
"test": "pnpm -r test",
"lint": "eslint .",
"setup-git-hook": "bash src/scripts/git-hook-init-command.sh"
},
"engines": {
"pnpm": ">=9.0.0"
"pnpm": ">=10.0.0"
},
"devDependencies": {
"@changesets/changelog-git": "^0.2.1",
Expand Down
89 changes: 84 additions & 5 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion frontend/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
packages:
- "apps/*"
- "packages/*"
- "configs/*"
- "configs/*"
injectWorkspacePackages: true
syncInjectedDepsAfterScripts:
- build
Loading