Github等のDevOpsを使用せずにVScodeのみでNext.jsのアプリをデプロイしたい
- Next.js14系のアプリケーションをデプロイする際にOryxのビルドが実行され、Detecting platformsで自動認識されるところでPHPプロジェクトと認識され、デプロイが失敗します。
こちらがエラーログです。
14:26:05 next-auth-test: Zip package size: 180 MB
14:26:08 next-auth-test: Fetching changes.
14:26:09 next-auth-test: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/6a37c6e0-976f-4e6e-a025-5997fdc7f5ae.zip (171.58 MB) to /tmp/zipdeploy/extracted
14:26:24 next-auth-test: Updating submodules.
14:26:25 next-auth-test: Preparing deployment for commit id 'e0ca5b5b-1'.
14:26:25 next-auth-test: PreDeployment: context.CleanOutputPath False
14:26:25 next-auth-test: PreDeployment: context.OutputPath /home/site/wwwroot
14:26:25 next-auth-test: Repository path is /tmp/zipdeploy/extracted
14:26:25 next-auth-test: Running oryx build...
14:26:25 next-auth-test: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20 -p virtualenv_name= --log-file /tmp/build-debug.log -i /tmp/8dc431e20791561 -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log
14:26:26 next-auth-test: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
14:26:26 next-auth-test: You can report issues at https://github.com/Microsoft/Oryx/issues
14:26:26 next-auth-test: Oryx Version: 0.2.20230829.1, Commit: 5bd3088141516cdbd815d62ada052654e91f0429, ReleaseTagName: 20230829.1
14:26:26 next-auth-test: Build Operation ID: 746b1541f7852dd4
14:26:26 next-auth-test: Repository Commit : e0ca5b5b-1480-4aaa-9b37-0e856da4e87a
14:26:26 next-auth-test: OS Type : bookworm
14:26:26 next-auth-test: Image Type : githubactions
14:26:26 next-auth-test: Detecting platforms...
14:26:33 next-auth-test: Error: Platform 'php' version '8.0' is unsupported. Supported versions: 8.1.22, 8.2.16, 8.2.9, 8.1.22, 8.2.16, 8.2.9
14:26:40 next-auth-test: Deployment failed.
ed.
フォルダ構成としては
- workspace .vscode test-app app prisma types .env package.json
となっています。
試したこと
- vscodeフォルダの位置をtest-app配下に置く
- .deploymentフォルダにprojectのコンフィグを記載する
- .deploymentフォルダにcommandコンフィグを記載し、npm install及びnpm run buildを実行する デプロイ自体は成功するが、wwwroot配下にプロジェクトが置かれないため、アプリの起動は不可
- .deploymentフォルダにDISABLE_HUGO_BUILD=trueを記載する
- setting.jsonを変更する
- リモートビルド時
{
"appService.zipIgnorePattern": ["node_modules{,/**}", ".vscode{,/**}"],
"appService.showBuildDuringDeployPrompt": true
}
- ローカルビルド時
{
"appService.showBuildDuringDeployPrompt": false,
"appService.preDeployTask": "npm: build"
}
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "install",
"group": "build",
"problemMatcher": [],
"label": "npm: install",
"detail": "install dependencies from package",
"options": {
"cwd": "${workspaceFolder}/test-app"
}
},
{
"type": "npm",
"script": "build",
"group": "build",
"problemMatcher": [],
"label": "npm: build",
"detail": "next build",
"dependsOn": ["npm: install"],
"options": {
"cwd": "${workspaceFolder}/test-app"
}
}
]
}
- ローカルビルドするとファイルのコピーが1時間以上経過しても終了しない
リモートビルド時にpackage.jsonがあるにもかかわらず、PHPプロジェクトと認識される理由やその解決策を探りたいです。