diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4b4f1a7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# +FROM python:3.9 + +# +WORKDIR /code + +# +COPY ./requirements.txt /code/requirements.txt + +# +RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt + +# +COPY ./ /code/app + +# +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] diff --git a/README.md b/README.md index e738dda..5e427b8 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,17 @@ Following resources were used for motivation in designing this API. - [Fast API Official Website](https://fastapi.tiangolo.com/) - [Udemy Course - FastAPI](https://www.udemy.com/course/fastapi-the-complete-course/) +## Docker Deployment + +- 3/9/22 : Added Docker deployment script for FAST API. + +``` +# Build the Docker image from the given file +docker build -t fast-image . +# Run container from the image created +docker run -d -p 80:80 --name my-fast-api fast-image +``` + ## Authors * **Amit Prafulla (APFirebolt)** - [My Website](https://apgiiit.com)