-
Notifications
You must be signed in to change notification settings - Fork 6
chore: 本番環境向けにCIを書き換え #67
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
Open
sora81dev
wants to merge
15
commits into
sf-kosen:main
Choose a base branch
from
sora81dev:chore/update-ci-for-production
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+88
−38
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
48da81f
chore: ready for new CI system
sora81dev c88d4a4
fix: typo in docker-compose.yml
sora81dev 3efc843
fix: use pnpm even in build section
sora81dev 7473876
fix: remove tsconfig-paths for ci
sora81dev 107df08
Update .dockerignore
Akikukeo1 47a7bd9
chore: update .dockerignore
sora81dev 4dbb19a
chore: remove package-lock.json for conflicts
sora81dev afb629d
Merge branch 'main' into chore/update-ci-for-production
sora81dev e2c5fc1
Update Dockerfile
sora81dev 0bcd26a
Update Dockerfile
sora81dev b4eedfb
fix: add packageManager info
sora81dev a46ac48
Update check.yml to remove pnpm version
Akikukeo1 b7698ac
Merge pull request #3 from Akikukeo1/patch-1
sora81dev 957e6db
Refactor Dockerfile stages for clarity and efficiency
Akikukeo1 e822157
refactor: Dockerfile stages for clarity and efficiency (#4)
sora81dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| .git | ||
| .github | ||
|
|
||
| Dockerfile | ||
| .dockerignore | ||
|
|
||
| node_modules/ | ||
| .pnpm-store/ | ||
|
|
||
| build/ | ||
| dist/ | ||
| .next/ | ||
| out/ | ||
|
|
||
| *.log | ||
|
|
||
| .env | ||
| .env.* | ||
|
|
||
| .DS_Store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,33 @@ | ||
| FROM node:24 | ||
| FROM node:24 AS base | ||
|
|
||
| COPY package*.json ./ | ||
| RUN npm install | ||
| ENV PNPM_HOME="/pnpm" | ||
| ENV PATH="$PNPM_HOME:$PATH" | ||
| RUN corepack enable | ||
|
|
||
| WORKDIR /app | ||
| COPY package.json pnpm-lock.yaml ./ | ||
| RUN corepack install | ||
|
|
||
| FROM base AS deps | ||
| RUN pnpm install --frozen-lockfile | ||
|
|
||
| FROM deps AS development | ||
| COPY . . | ||
| CMD ["npm", "run", "dev"] | ||
| CMD ["pnpm", "dev"] | ||
|
|
||
| FROM deps AS builder | ||
| COPY . . | ||
| RUN pnpm run build | ||
|
|
||
| FROM base AS production | ||
| ENV NODE_ENV=production | ||
|
|
||
| RUN pnpm install --frozen-lockfile --prod | ||
|
sora81dev marked this conversation as resolved.
|
||
|
|
||
| # NOTE: 書き込みが発生するなら変更する必要がある | ||
| COPY --from=builder /app/build ./build | ||
|
|
||
| USER node | ||
| EXPOSE 3000 | ||
|
|
||
| CMD ["node", "./build/index.js"] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,34 @@ | ||
| { | ||
| "name": "nanase-bot", | ||
| "version": "1.0.0", | ||
| "description": "", | ||
| "license": "ISC", | ||
| "author": "", | ||
| "main": "src/index.ts", | ||
| "scripts": { | ||
| "dev": "ts-node src/index.ts", | ||
| "build": "tsc", | ||
| "start": "node -r tsconfig-paths/register ./build/index.js", | ||
| "// linters //": "", | ||
| "typecheck": "tsc --noEmit", | ||
| "lint": "biome lint .", | ||
| "format": "biome format . --write", | ||
| "check": "biome check .", | ||
| "fix": "biome check . --write" | ||
| }, | ||
| "devDependencies": { | ||
| "@biomejs/biome": "2.5.3", | ||
| "@types/node": "^25.0.3", | ||
| "ts-node": "^10.9.2", | ||
| "tsconfig-paths": "^4.2.0", | ||
| "typescript": "^5.9.3" | ||
| }, | ||
| "dependencies": { | ||
| "discord.js": "^14.26.5", | ||
| "dotenv": "^17.2.3" | ||
| }, | ||
| "overrides": { | ||
| "axios": "1.16.0" | ||
| } | ||
| "name": "nanase-bot", | ||
| "version": "1.0.0", | ||
| "description": "", | ||
| "license": "ISC", | ||
| "author": "", | ||
| "main": "src/index.ts", | ||
| "packageManager": "pnpm@11.9.0", | ||
| "scripts": { | ||
| "dev": "ts-node src/index.ts", | ||
| "build": "tsc", | ||
| "start": "node -r tsconfig-paths/register ./build/index.js", | ||
| "// linters //": "", | ||
| "typecheck": "tsc --noEmit", | ||
| "lint": "biome lint .", | ||
| "format": "biome format . --write", | ||
| "check": "biome check .", | ||
| "fix": "biome check . --write" | ||
| }, | ||
| "devDependencies": { | ||
| "@biomejs/biome": "2.5.3", | ||
| "@types/node": "^25.0.3", | ||
| "ts-node": "^10.9.2", | ||
| "tsconfig-paths": "^4.2.0", | ||
| "typescript": "^5.9.3" | ||
| }, | ||
| "dependencies": { | ||
| "discord.js": "^14.26.5", | ||
| "dotenv": "^17.2.3" | ||
| }, | ||
| "overrides": { | ||
| "axios": "1.16.0" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: sf-kosen/Nanase-Bot
Length of output: 452
🏁 Script executed:
Repository: sf-kosen/Nanase-Bot
Length of output: 2384
🌐 Web query:
pnpm default modules-dir node_modules virtual-store-dir pnpm 11 documentation💡 Result:
In pnpm v11, the configuration for directory locations is managed primarily through the pnpm-workspace.yaml file or global configuration, as pnpm no longer reads settings from the pnpm field in package.json [1][2][3]. The default settings for these directories are: modules-dir Default: node_modules [4] This is the directory where pnpm installs your project's dependencies [4]. virtual-store-dir Default: node_modules/.pnpm [4] This directory acts as the virtual store containing links to the central package store [4]. It is where all direct and indirect dependencies are linked [4]. Configuration These settings can be configured in your project's pnpm-workspace.yaml file or via global configuration (config.yaml) [1][3]. For example: modulesDir: node_modules virtualStoreDir:.pnpm Note that while the default virtual-store-dir is node_modules/.pnpm, setting it to a relative path like.pnpm can help create cleaner stack traces, as the dependency paths will appear one directory higher [4][5]. Customizing the virtual-store-dir is also a common method for resolving long path issues on Windows by placing the store in the root of a drive [4][5]. Every project must have its own virtual store; it cannot be shared between multiple projects, except within a workspace where the root is shared [4].
Citations:
Align the dependency volume with pnpm’s module directory.
docker-compose.ymlmounts/app/node_module, but pnpm installs dependencies into/app/node_modulesby default, and this project does not configuremodules-dir. The development bind mount exposes the working tree, so that volume would leave the installed dependencies unreadable; mount/app/node_modulesunless a custom dependency directory is deliberately set.Proposed compose volume change
🤖 Prompt for AI Agents