Browse Source

๐ŸŒ Add Korean translation for `docs/ko/docs/deployment/server-workers.md` (#4935)

pull/11011/head
gyudoza 1 year ago
committed by GitHub
parent
commit
79ab317cbd
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 180
      docs/ko/docs/deployment/server-workers.md

180
docs/ko/docs/deployment/server-workers.md

@ -0,0 +1,180 @@
# ์„œ๋ฒ„ ์›Œ์ปค - ๊ตฌ๋‹ˆ์ฝ˜๊ณผ ์œ ๋น„์ฝ˜
์ „๋‹จ๊ณ„์—์„œ์˜ ๋ฐฐํฌ ๊ฐœ๋…๋“ค์„ ๋‹ค์‹œ ํ™•์ธํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค:
* ๋ณด์•ˆ - HTTPS
* ์„œ๋ฒ„ ์‹œ์ž‘๊ณผ ๋™์‹œ์— ์‹คํ–‰ํ•˜๊ธฐ
* ์žฌ์‹œ์ž‘
* **๋ณต์ œ๋ณธ (์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค์˜ ์ˆซ์ž)**
* ๋ฉ”๋ชจ๋ฆฌ
* ์‹œ์ž‘ํ•˜๊ธฐ ์ „์˜ ์—ฌ๋Ÿฌ ๋‹จ๊ณ„๋“ค
์ง€๊ธˆ๊นŒ์ง€ ๋ฌธ์„œ์˜ ๋ชจ๋“  ํŠœํ† ๋ฆฌ์–ผ์„ ์ฐธ๊ณ ํ•˜์—ฌ **๋‹จ์ผ ํ”„๋กœ์„ธ์Šค**๋กœ Uvicorn๊ณผ ๊ฐ™์€ **์„œ๋ฒ„ ํ”„๋กœ๊ทธ๋žจ**์„ ์‹คํ–‰ํ–ˆ์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค.
์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋ฐฐํฌํ•  ๋•Œ **๋‹ค์ค‘ ์ฝ”์–ด**๋ฅผ ํ™œ์šฉํ•˜๊ณ  ๋” ๋งŽ์€ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋„๋ก **ํ”„๋กœ์„ธ์Šค ๋ณต์ œ๋ณธ**์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
์ „ ๊ณผ์ •์ด์—ˆ๋˜ [๋ฐฐํฌ ๊ฐœ๋…๋“ค](./concepts.md){.internal-link target=_blank}์—์„œ ๋ณธ ๊ฒƒ์ฒ˜๋Ÿผ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.
์ง€๊ธˆ๋ถ€ํ„ฐ <a href="https://gunicorn.org/" class="external-link" target="_blank">**๊ตฌ๋‹ˆ์ฝ˜**</a>์„ **์œ ๋น„์ฝ˜ ์›Œ์ปค ํ”„๋กœ์„ธ์Šค**์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ๋ ค๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.
!!! ์ •๋ณด
๋งŒ์•ฝ ๋„์ปค์™€ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ๊ฐ™์€ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค๋ฉด ๋‹ค์Œ ์ฑ•ํ„ฐ [FastAPI์™€ ์ปจํ…Œ์ด๋„ˆ - ๋„์ปค](./docker.md){.internal-link target=_blank}์—์„œ ๋” ๋งŽ์€ ์ •๋ณด๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
ํŠนํžˆ, ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค์—์„œ ์‹คํ–‰ํ•  ๋•Œ๋Š” ๊ตฌ๋‹ˆ์ฝ˜์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ๋Œ€์‹  ์ปจํ…Œ์ด๋„ˆ๋‹น ํ•˜๋‚˜์˜ ์œ ๋น„์ฝ˜ ํ”„๋กœ์„ธ์Šค๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ์ด ์žฅ์˜ ๋’ท๋ถ€๋ถ„์—์„œ ์„ค๋ช…ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
## ๊ตฌ๋‹ˆ์ฝ˜๊ณผ ์œ ๋น„์ฝ˜ ์›Œ์ปค
**Gunicorn**์€ **WSGI ํ‘œ์ค€**์„ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„œ๋ฒ„์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๊ตฌ๋‹ˆ์ฝ˜์ด ํ”Œ๋ผ์Šคํฌ์™€ ์Ÿ๊ณ ์™€ ๊ฐ™์€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ๊ตฌ๋‹ˆ์ฝ˜ ์ž์ฒด๋Š” ์ตœ์‹  **<a href="https://asgi.readthedocs.io/en/latest/" class="external-link" target="_blank">ASGI ํ‘œ์ค€</a>**์„ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— FastAPI์™€ ํ˜ธํ™˜๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
ํ•˜์ง€๋งŒ ๊ตฌ๋‹ˆ์ฝ˜์€ **ํ”„๋กœ์„ธ์Šค ๊ด€๋ฆฌ์ž**์—ญํ• ์„ ํ•˜๊ณ  ์‚ฌ์šฉ์ž์—๊ฒŒ ํŠน์ • **์›Œ์ปค ํ”„๋กœ์„ธ์Šค ํด๋ž˜์Šค**๋ฅผ ์•Œ๋ ค์ค๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ ๊ตฌ๋‹ˆ์ฝ˜์€ ํ•ด๋‹น ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•˜๋‚˜ ์ด์ƒ์˜ **์›Œ์ปค ํ”„๋กœ์„ธ์Šค**๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.
๊ทธ๋ฆฌ๊ณ  **์œ ๋น„์ฝ˜**์€ **๊ตฌ๋‹ˆ์ฝ˜๊ณผ ํ˜ธํ™˜๋˜๋Š” ์›Œ์ปค ํด๋ž˜์Šค**๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
์ด ์กฐํ•ฉ์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌ๋‹ˆ์ฝ˜์€ **ํ”„๋กœ์„ธ์Šค ๊ด€๋ฆฌ์ž** ์—ญํ• ์„ ํ•˜๋ฉฐ **ํฌํŠธ**์™€ **IP**๋ฅผ ๊ด€์ฐฐํ•˜๊ณ , **์œ ๋น„์ฝ˜ ํด๋ž˜์Šค**๋ฅผ ์‹คํ–‰ํ•˜๋Š” ์›Œ์ปค ํ”„๋กœ์„ธ์Šค๋กœ ํ†ต์‹  ์ •๋ณด๋ฅผ **์ „์†ก**ํ•ฉ๋‹ˆ๋‹ค.
๊ทธ๋ฆฌ๊ณ  ๋‚˜์„œ ๊ตฌ๋‹ˆ์ฝ˜๊ณผ ํ˜ธํ™˜๋˜๋Š” **์œ ๋น„์ฝ˜ ์›Œ์ปค** ํด๋ž˜์Šค๋Š” ๊ตฌ๋‹ˆ์ฝ˜์ด ๋ณด๋‚ธ ๋ฐ์ดํ„ฐ๋ฅผ FastAPI์—์„œ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ASGI ํ‘œ์ค€์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ์ผ์„ ๋‹ด๋‹นํ•ฉ๋‹ˆ๋‹ค.
## ๊ตฌ๋‹ˆ์ฝ˜๊ณผ ์œ ๋น„์ฝ˜ ์„ค์น˜ํ•˜๊ธฐ
<div class="termy">
```console
$ pip install "uvicorn[standard]" gunicorn
---> 100%
```
</div>
์ด ๋ช…๋ น์–ด๋Š” ์œ ๋น„์ฝ˜ `standard` ์ถ”๊ฐ€ ํŒจํ‚ค์ง€(์ข‹์€ ์„ฑ๋Šฅ์„ ์œ„ํ•œ)์™€ ๊ตฌ๋‹ˆ์ฝ˜์„ ์„ค์น˜ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
## ๊ตฌ๋‹ˆ์ฝ˜์„ ์œ ๋น„์ฝ˜ ์›Œ์ปค์™€ ํ•จ๊ป˜ ์‹คํ–‰ํ•˜๊ธฐ
์„ค์น˜ ํ›„ ๊ตฌ๋‹ˆ์ฝ˜ ์‹คํ–‰ํ•˜๊ธฐ:
<div class="termy">
```console
$ gunicorn main:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:80
[19499] [INFO] Starting gunicorn 20.1.0
[19499] [INFO] Listening at: http://0.0.0.0:80 (19499)
[19499] [INFO] Using worker: uvicorn.workers.UvicornWorker
[19511] [INFO] Booting worker with pid: 19511
[19513] [INFO] Booting worker with pid: 19513
[19514] [INFO] Booting worker with pid: 19514
[19515] [INFO] Booting worker with pid: 19515
[19511] [INFO] Started server process [19511]
[19511] [INFO] Waiting for application startup.
[19511] [INFO] Application startup complete.
[19513] [INFO] Started server process [19513]
[19513] [INFO] Waiting for application startup.
[19513] [INFO] Application startup complete.
[19514] [INFO] Started server process [19514]
[19514] [INFO] Waiting for application startup.
[19514] [INFO] Application startup complete.
[19515] [INFO] Started server process [19515]
[19515] [INFO] Waiting for application startup.
[19515] [INFO] Application startup complete.
```
</div>
๊ฐ ์˜ต์…˜์ด ๋ฌด์—‡์„ ์˜๋ฏธํ•˜๋Š”์ง€ ์‚ดํŽด๋ด…์‹œ๋‹ค:
* ์ด๊ฒƒ์€ ์œ ๋น„์ฝ˜๊ณผ ๋˜‘๊ฐ™์€ ๋ฌธ๋ฒ•์ž…๋‹ˆ๋‹ค. `main`์€ ํŒŒ์ด์ฌ ๋ชจ๋“ˆ ๋„ค์ž„ "`main`"์„ ์˜๋ฏธํ•˜๋ฏ€๋กœ `main.py`ํŒŒ์ผ์„ ๋œปํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  `app`์€ **FastAPI** ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ๋“ค์–ด ์žˆ๋Š” ๋ณ€์ˆ˜์˜ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.
* `main:app`์ด ํŒŒ์ด์ฌ์˜ `import` ๋ฌธ๋ฒ•๊ณผ ํก์‚ฌํ•œ ๋ฉด์ด ์žˆ๋‹ค๋Š” ๊ฑธ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:
```Python
from main import app
```
* ๊ณง, `main:app`์•ˆ์— ์žˆ๋Š” ์ฝœ๋ก ์˜ ์˜๋ฏธ๋Š” ํŒŒ์ด์ฌ์—์„œ `from main import app`์—์„œ์˜ `import`์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.
* `--workers`: ์‚ฌ์šฉํ•  ์›Œ์ปค ํ”„๋กœ์„ธ์Šค์˜ ๊ฐœ์ˆ˜์ด๋ฉฐ ์ˆซ์ž๋งŒํผ์˜ ์œ ๋น„์ฝ˜ ์›Œ์ปค๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์ด ์˜ˆ์ œ์—์„œ๋Š” 4๊ฐœ์˜ ์›Œ์ปค๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
* `--worker-class`: ์›Œ์ปค ํ”„๋กœ์„ธ์Šค์—์„œ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๊ตฌ๋‹ˆ์ฝ˜๊ณผ ํ˜ธํ™˜๋˜๋Š” ์›Œ์ปคํด๋ž˜์Šค.
* ์ด๋Ÿฐ์‹์œผ๋กœ ๊ตฌ๋‹ˆ์ฝ˜์ด importํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ํด๋ž˜์Šค๋ฅผ ์ „๋‹ฌํ•ด์ค๋‹ˆ๋‹ค:
```Python
import uvicorn.workers.UvicornWorker
```
* `--bind`: ๊ตฌ๋‹ˆ์ฝ˜์ด ๊ด€์ฐฐํ•  IP์™€ ํฌํŠธ๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ์ฝœ๋ก  (`:`)์„ ์‚ฌ์šฉํ•˜์—ฌ IP์™€ ํฌํŠธ๋ฅผ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค.
* ๋งŒ์•ฝ์— `--bind 0.0.0.0:80` (๊ตฌ๋‹ˆ์ฝ˜ ์˜ต์…˜) ๋Œ€์‹  ์œ ๋น„์ฝ˜์„ ์ง์ ‘ ์‹คํ–‰ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด `--host 0.0.0.0`๊ณผ `--port 80`์„ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
์ถœ๋ ฅ์—์„œ ๊ฐ ํ”„๋กœ์„ธ์Šค์— ๋Œ€ํ•œ **PID** (process ID)๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (๋‹จ์ˆœํ•œ ์ˆซ์ž์ž…๋‹ˆ๋‹ค)
์ถœ๋ ฅ ๋‚ด์šฉ:
* ๊ตฌ๋‹ˆ์ฝ˜ **ํ”„๋กœ์„ธ์Šค ๋งค๋‹ˆ์ €**๋Š” PID `19499`๋กœ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. (์ง์ ‘ ์‹คํ–‰ํ•  ๊ฒฝ์šฐ ์ˆซ์ž๊ฐ€ ๋‹ค๋ฅผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค)
* ๋‹ค์Œ์œผ๋กœ `Listening at: http://0.0.0.0:80`์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.
* ๊ทธ๋Ÿฐ ๋‹ค์Œ ์‚ฌ์šฉํ•ด์•ผํ•  `uvicorn.workers.UvicornWorker`์˜ ์›Œ์ปคํด๋ž˜์Šค๋ฅผ ํƒ์ง€ํ•ฉ๋‹ˆ๋‹ค.
* ๊ทธ๋ฆฌ๊ณ  PID `19511`, `19513`, `19514`, ๊ทธ๋ฆฌ๊ณ  `19515`๋ฅผ ๊ฐ€์ง„ **4๊ฐœ์˜ ์›Œ์ปค**๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
๋˜ํ•œ ๊ตฌ๋‹ˆ์ฝ˜์€ ์›Œ์ปค์˜ ์ˆ˜๋ฅผ ์œ ์ง€ํ•˜๊ธฐ ์œ„ํ•ด **์ฃฝ์€ ํ”„๋กœ์„ธ์Šค**๋ฅผ ๊ด€๋ฆฌํ•˜๊ณ  **์žฌ์‹œ์ž‘**ํ•˜๋Š” ์ž‘์—…์„ ์ฑ…์ž„์ง‘๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์ด๋ฒˆ ์žฅ ์ƒ๋‹จ ๋ชฉ๋ก์˜ **์žฌ์‹œ์ž‘** ๊ฐœ๋…์„ ๋ถ€๋ถ„์ ์œผ๋กœ ๋„์™€์ฃผ๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
๊ทธ๋Ÿผ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ  ํ•„์š”ํ•  ๊ฒฝ์šฐ ์™ธ๋ถ€์—์„œ **๊ตฌ๋‹ˆ์ฝ˜์„ ์žฌ์‹œ์ž‘**ํ•˜๊ณ , ํ˜น์€ **์„œ๋ฒ„๋ฅผ ์‹œ์ž‘ํ•  ๋•Œ ์‹คํ–‰**ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๊ณ  ์‹ถ์–ดํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
## ์œ ๋น„์ฝ˜๊ณผ ์›Œ์ปค
์œ ๋น„์ฝ˜์€ ๋ช‡ ๊ฐœ์˜ **์›Œ์ปค ํ”„๋กœ์„ธ์Šค**์™€ ํ•จ๊ป˜ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ์„ ํƒ์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
๊ทธ๋Ÿผ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ , ์œ ๋น„์ฝ˜์€ ์›Œ์ปค ํ”„๋กœ์„ธ์Šค๋ฅผ ๋‹ค๋ฃจ๋Š” ๋ฐ์— ์žˆ์–ด์„œ ๊ตฌ๋‹ˆ์ฝ˜๋ณด๋‹ค ๋” ์ œํ•œ์ ์ž…๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ด ์ˆ˜์ค€(ํŒŒ์ด์ฌ ์ˆ˜์ค€)์˜ ํ”„๋กœ์„ธ์Šค ๊ด€๋ฆฌ์ž๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ๊ตฌ๋‹ˆ์ฝ˜์„ ํ”„๋กœ์„ธ์Šค ๊ด€๋ฆฌ์ž๋กœ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
๋ณดํ†ต ์ด๋ ‡๊ฒŒ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:
<div class="termy">
```console
$ uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
<font color="#A6E22E">INFO</font>: Uvicorn running on <b>http://0.0.0.0:8080</b> (Press CTRL+C to quit)
<font color="#A6E22E">INFO</font>: Started parent process [<font color="#A1EFE4"><b>27365</b></font>]
<font color="#A6E22E">INFO</font>: Started server process [<font color="#A1EFE4">27368</font>]
<font color="#A6E22E">INFO</font>: Waiting for application startup.
<font color="#A6E22E">INFO</font>: Application startup complete.
<font color="#A6E22E">INFO</font>: Started server process [<font color="#A1EFE4">27369</font>]
<font color="#A6E22E">INFO</font>: Waiting for application startup.
<font color="#A6E22E">INFO</font>: Application startup complete.
<font color="#A6E22E">INFO</font>: Started server process [<font color="#A1EFE4">27370</font>]
<font color="#A6E22E">INFO</font>: Waiting for application startup.
<font color="#A6E22E">INFO</font>: Application startup complete.
<font color="#A6E22E">INFO</font>: Started server process [<font color="#A1EFE4">27367</font>]
<font color="#A6E22E">INFO</font>: Waiting for application startup.
<font color="#A6E22E">INFO</font>: Application startup complete.
```
</div>
์ƒˆ๋กœ์šด ์˜ต์…˜์ธ `--workers`์€ ์œ ๋น„์ฝ˜์—๊ฒŒ 4๊ฐœ์˜ ์›Œ์ปค ํ”„๋กœ์„ธ์Šค๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๊ณ  ์•Œ๋ ค์ค๋‹ˆ๋‹ค.
๊ฐ ํ”„๋กœ์„ธ์Šค์˜ **PID**๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. `27365`๋Š” ์ƒ์œ„ ํ”„๋กœ์„ธ์Šค(**ํ”„๋กœ์„ธ์Šค ๋งค๋‹ˆ์ €**), ๊ทธ๋ฆฌ๊ณ  ๊ฐ๊ฐ์˜ ์›Œ์ปคํ”„๋กœ์„ธ์Šค๋Š” `27368`, `27369`, `27370`, ๊ทธ๋ฆฌ๊ณ  `27367`์ž…๋‹ˆ๋‹ค.
## ๋ฐฐํฌ ๊ฐœ๋…๋“ค
์—ฌ๊ธฐ์—์„œ๋Š” **์œ ๋น„์ฝ˜ ์›Œ์ปค ํ”„๋กœ์„ธ์Šค**๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” **๊ตฌ๋‹ˆ์ฝ˜**(๋˜๋Š” ์œ ๋น„์ฝ˜)์„ ์‚ฌ์šฉํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ **๋ณ‘๋ ฌํ™”**ํ•˜๊ณ , CPU **๋ฉ€ํ‹ฐ ์ฝ”์–ด**์˜ ์žฅ์ ์„ ํ™œ์šฉํ•˜๊ณ , **๋” ๋งŽ์€ ์š”์ฒญ**์„ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์„ ์‚ดํŽด๋ณด์•˜์Šต๋‹ˆ๋‹ค.
์›Œ์ปค๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์€ ๋ฐฐํฌ ๊ฐœ๋… ๋ชฉ๋ก์—์„œ ์ฃผ๋กœ **๋ณต์ œ๋ณธ** ๋ถ€๋ถ„๊ณผ **์žฌ์‹œ์ž‘**์— ์•ฝ๊ฐ„ ๋„์›€์ด ๋˜์ง€๋งŒ ๋‹ค๋ฅธ ๋ฐฐํฌ ๊ฐœ๋…๋“ค๋„ ๋‹ค๋ฃจ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค:
* **๋ณด์•ˆ - HTTPS**
* **์„œ๋ฒ„ ์‹œ์ž‘๊ณผ ๋™์‹œ์— ์‹คํ–‰ํ•˜๊ธฐ**
* ***์žฌ์‹œ์ž‘***
* ๋ณต์ œ๋ณธ (์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค์˜ ์ˆซ์ž)
* **๋ฉ”๋ชจ๋ฆฌ**
* **์‹œ์ž‘ํ•˜๊ธฐ ์ „์˜ ์—ฌ๋Ÿฌ ๋‹จ๊ณ„๋“ค**
## ์ปจํ…Œ์ด๋„ˆ์™€ ๋„์ปค
๋‹ค์Œ ์žฅ์ธ [FastAPI์™€ ์ปจํ…Œ์ด๋„ˆ - ๋„์ปค](./docker.md){.internal-link target=_blank}์—์„œ ๋‹ค๋ฅธ **๋ฐฐํฌ ๊ฐœ๋…๋“ค**์„ ๋‹ค๋ฃจ๋Š” ์ „๋žต๋“ค์„ ์•Œ๋ ค๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.
๋˜ํ•œ ๊ฐ„๋‹จํ•œ ์ผ€์ด์Šค์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š”, **๊ตฌ๋‹ˆ์ฝ˜๊ณผ ์œ ๋น„์ฝ˜ ์›Œ์ปค**๊ฐ€ ํฌํ•จ๋ผ ์žˆ๋Š” **๊ณต์‹ ๋„์ปค ์ด๋ฏธ์ง€**์™€ ํ•จ๊ป˜ ๋ช‡ ๊ฐ€์ง€ ๊ธฐ๋ณธ ๊ตฌ์„ฑ์„ ๋ณด์—ฌ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.
๊ทธ๋ฆฌ๊ณ  ๋‹จ์ผ ์œ ๋น„์ฝ˜ ํ”„๋กœ์„ธ์Šค(๊ตฌ๋‹ˆ์ฝ˜ ์—†์ด)๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก **์‚ฌ์šฉ์ž ์ž์‹ ์˜ ์ด๋ฏธ์ง€๋ฅผ ์ฒ˜์Œ๋ถ€ํ„ฐ ๊ตฌ์ถ•**ํ•˜๋Š” ๋ฐฉ๋ฒ•๋„ ๋ณด์—ฌ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ๊ฐ„๋‹จํ•œ ๊ณผ์ •์ด๋ฉฐ, **์ฟ ๋ฒ„๋„คํ‹ฐ์Šค**์™€ ๊ฐ™์€ ๋ถ„์‚ฐ ์ปจํ…Œ์ด๋„ˆ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ์„ ์‚ฌ์šฉํ•  ๋•Œ ์ˆ˜ํ–‰ํ•  ์ž‘์—…์ž…๋‹ˆ๋‹ค.
## ์š”์•ฝ
๋‹น์‹ ์€ **๊ตฌ๋‹ˆ์ฝ˜**(๋˜๋Š” ์œ ๋น„์ฝ˜)์„ ์œ ๋น„์ฝ˜ ์›Œ์ปค์™€ ํ•จ๊ป˜ ํ”„๋กœ์„ธ์Šค ๊ด€๋ฆฌ์ž๋กœ ์‚ฌ์šฉํ•˜์—ฌ **๋ฉ€ํ‹ฐ-์ฝ”์–ด CPU**๋ฅผ ํ™œ์šฉํ•˜๋Š” **๋ฉ€ํ‹ฐ ํ”„๋กœ์„ธ์Šค๋ฅผ ๋ณ‘๋ ฌ๋กœ ์‹คํ–‰**ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๋‹ค๋ฅธ ๋ฐฐํฌ ๊ฐœ๋…์„ ์ง์ ‘ ๋‹ค๋ฃจ๋ฉด์„œ **์ž์‹ ๋งŒ์˜ ๋ฐฐํฌ ์‹œ์Šคํ…œ**์„ ๊ตฌ์„ฑํ•˜๋Š” ๊ฒฝ์šฐ ์ด๋Ÿฌํ•œ ๋„๊ตฌ์™€ ๊ฐœ๋…๋“ค์„ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๋‹ค์Œ ์žฅ์—์„œ ์ปจํ…Œ์ด๋„ˆ(์˜ˆ: ๋„์ปค ๋ฐ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค)์™€ ํ•จ๊ป˜ํ•˜๋Š” **FastAPI**์— ๋Œ€ํ•ด ๋ฐฐ์›Œ๋ณด์„ธ์š”. ์ด๋Ÿฌํ•œ ํˆด์—๋Š” ๋‹ค๋ฅธ **๋ฐฐํฌ ๊ฐœ๋…**๋“ค์„ ๊ฐ„๋‹จํžˆ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค. โœจ
Loadingโ€ฆ
Cancel
Save