diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8b633cb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.8 +WORKDIR /app +COPY requirements.txt ./ +RUN pip3 install --no-cache-dir -r requirements.txt +COPY . . + +CMD ["uvicorn", "main:app", "--reload"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..08241fc --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# This repo is for [Youtube FastAPI 4 hours full course](https://www.youtube.com/watch?v=7t2alSnE2-I) + +## Created by [Sarthak](https://twitter.com/Sarthaksavvy) + +### The Docker usage is simply based on docker-compose: + +*To build the container* + +``` +docker-compose -f docker-compose.yaml up --build +``` +It should be up now. + +*To login to the container(if you want)* + +``` +docker-compose -f docker-compose.yaml exec /bin/bash +``` + + +> Note: if you updated/edited the code just run the build command again to get the new changes. + diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..0ce58fc --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +version: "3.7" + +services: + api_v1: + build: + context: . + dockerfile: Dockerfile + container_name: fastapi_bitfumes_full_course_v1 + ports: + - "8000:8000" + network_mode: host \ No newline at end of file