From 836a00e104bb423382991c0a305e6146718af8bf Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Fri, 11 Aug 2023 19:49:36 +0900 Subject: [PATCH] Add cloudflare-pages-ja.md --- docs/cloudflare-pages-ja.md | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 docs/cloudflare-pages-ja.md diff --git a/docs/cloudflare-pages-ja.md b/docs/cloudflare-pages-ja.md new file mode 100644 index 00000000..6409a934 --- /dev/null +++ b/docs/cloudflare-pages-ja.md @@ -0,0 +1,38 @@ +# Cloudflare Pages 導入ガイド + +## 新規プロジェクトの作成方法 +GitHub でこのプロジェクトをフォークし、dash.cloudflare.com にログインして Pages にアクセスします。 + +1. "Create a project" をクリックする。 +2. "Connect to Git" を選択する。 +3. Cloudflare Pages を GitHub アカウントに接続します。 +4. フォークしたプロジェクトを選択します。 +5. "Begin setup" をクリックする。 +6. "Project name" と "Production branch" はデフォルト値を使用するか、必要に応じて変更してください。 +7. "Build Settings" で、"Framework presets" オプションを選択し、"Next.js" を選択します。 +8. node:buffer のバグのため、デフォルトの "Build command" は使用しないでください。代わりに、以下のコマンドを使用してください: + ``` + npx https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/4930842298/npm-package-next-on-pages-230 --experimental-minify + ``` +9. "Build output directory" はデフォルト値を使用し、変更しない。 +10. "Root Directory" を変更しない。 +11. "Environment variables" は、">" をクリックし、"Add variable" をクリックします。そして以下の情報を入力します: + - `NODE_VERSION=20.1` + - `NEXT_TELEMETRY_DISABLE=1` + - `OPENAI_API_KEY=your_own_API_key` + - `YARN_VERSION=1.22.19` + - `PHP_VERSION=7.4` + + 必要に応じて、以下の項目を入力してください: + + - `CODE= Optional, access passwords, multiple passwords can be separated by commas` + - `OPENAI_ORG_ID= Optional, specify the organization ID in OpenAI` + - `HIDE_USER_API_KEY=1 Optional, do not allow users to enter their own API key` + - `DISABLE_GPT4=1 Optional, do not allow users to use GPT-4` + +12. "Save and Deploy" をクリックする。 +13. 互換性フラグを記入する必要があるため、"Cancel deployment" をクリックする。 +14. "Build settings" の "Functions" から "Compatibility flags" を見つける。 +15. "Configure Production compatibility flag" と "Configure Preview compatibility flag" の両方に "nodejs_compat "を記入する。 +16. "Deployments" に移動し、"Retry deployment" をクリックします。 +17. お楽しみください。