From 554d0062325f86b5cdadabd78f94fbbfe9d42222 Mon Sep 17 00:00:00 2001 From: zzsza Date: Fri, 9 Feb 2024 22:21:49 +0900 Subject: [PATCH] feat: FastAPI Docker Image Port --- 02-online-serving(fastapi)/projects/web_single/Dockerfile | 2 +- 02-online-serving(fastapi)/projects/web_single/README.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/02-online-serving(fastapi)/projects/web_single/Dockerfile b/02-online-serving(fastapi)/projects/web_single/Dockerfile index a12de8e..c420290 100644 --- a/02-online-serving(fastapi)/projects/web_single/Dockerfile +++ b/02-online-serving(fastapi)/projects/web_single/Dockerfile @@ -11,4 +11,4 @@ WORKDIR /code COPY --from=requirements-stage /tmp/requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt COPY . /code -CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"] +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/02-online-serving(fastapi)/projects/web_single/README.md b/02-online-serving(fastapi)/projects/web_single/README.md index ff83884..9e4ed51 100644 --- a/02-online-serving(fastapi)/projects/web_single/README.md +++ b/02-online-serving(fastapi)/projects/web_single/README.md @@ -38,6 +38,12 @@ curl "http://0.0.0.0:8000/predict/1" docker build -t web_single_example . ``` +## Docker Run +``` +docker run -p 8000:8000 web_single_example +``` + + ---