]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🌐 Add Japanese translation for Deployment - Manually (#2313)
authorT. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Sat, 9 Jan 2021 18:51:42 +0000 (03:51 +0900)
committerGitHub <noreply@github.com>
Sat, 9 Jan 2021 18:51:42 +0000 (19:51 +0100)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
docs/ja/docs/deployment/manually.md [new file with mode: 0644]
docs/ja/mkdocs.yml

diff --git a/docs/ja/docs/deployment/manually.md b/docs/ja/docs/deployment/manually.md
new file mode 100644 (file)
index 0000000..3296ba7
--- /dev/null
@@ -0,0 +1,74 @@
+# 手動デプロイ
+
+**FastAPI** を手動でデプロイすることもできます。
+
+以下の様なASGI対応のサーバをインストールする必要があります:
+
+=== "Uvicorn"
+
+    * <a href="https://www.uvicorn.org/" class="external-link" target="_blank">Uvicorn</a>, uvloopとhttptoolsを基にした高速なASGIサーバ。
+
+    <div class="termy">
+
+    ```console
+    $ pip install uvicorn[standard]
+
+    ---> 100%
+    ```
+
+    </div>
+
+!!! tip "豆知識"
+    `standard` を加えることで、Uvicornがインストールされ、いくつかの推奨される依存関係を利用するようになります。
+    
+    これには、`asyncio` の高性能な完全互換品である `uvloop` が含まれ、並行処理のパフォーマンスが大幅に向上します。
+
+=== "Hypercorn"
+
+    * <a href="https://gitlab.com/pgjones/hypercorn" class="external-link" target="_blank">Hypercorn</a>, HTTP/2にも対応しているASGIサーバ。
+
+    <div class="termy">
+
+    ```console
+    $ pip install hypercorn
+
+    ---> 100%
+    ```
+
+    </div>
+
+    ...または、これら以外のASGIサーバ。
+
+そして、チュートリアルと同様な方法でアプリケーションを起動して下さい。ただし、以下の様に`--reload` オプションは使用しないで下さい:
+
+=== "Uvicorn"
+
+    <div class="termy">
+
+    ```console
+    $ uvicorn main:app --host 0.0.0.0 --port 80
+
+    <span style="color: green;">INFO</span>:     Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
+    ```
+
+    </div>
+
+=== "Hypercorn"
+
+    <div class="termy">
+
+    ```console
+    $ hypercorn main:app --bind 0.0.0.0:80
+
+    Running on 0.0.0.0:8080 over http (CTRL + C to quit)
+    ```
+
+    </div>
+
+停止した場合に自動的に再起動させるツールを設定したいかもしれません。
+
+さらに、<a href="https://gunicorn.org/" class="external-link" target="_blank">Gunicorn</a>をインストールして<a href="https://www.uvicorn.org/#running-with-gunicorn" class="external-link" target="_blank">Uvicornのマネージャーとして使用したり</a>、複数のワーカーでHypercornを使用したいかもしれません。
+
+ワーカー数などの微調整も行いたいかもしれません。
+
+しかしこれら全てをやろうとすると、自動的にこれらを行うDockerイメージを使う方が楽かもしれません。
index 2ded96a7857db35b8425f37dbb6ab3bb4c3ece12..6d26498cd8c664856737d052c4003f40e2777367 100644 (file)
@@ -73,6 +73,7 @@ nav:
   - advanced/custom-response.md
 - デプロイ:
   - deployment/index.md
+  - deployment/manually.md
 - project-generation.md
 - alternatives.md
 - history-design-future.md