Skip to content

miguepoloc/weather_station

Repository files navigation

Fastapi + Docker

This project is a simple example of how to use Fastapi with Docker.

Run

docker build -t fastapi .
docker run --env-file .env -d --name fastapi_container -p 8002:8080 fastapi

Test

curl http://localhost:8002

Bash output:

{"message":"Hello World"}

Go to url: http://localhost:8002

Stop

docker stop fastapi

Remove

docker rm fastapi

Remove image

docker rmi fastapi

Documentation

Go to url: http://localhost:8002/docs

Install local

  • Create a virtual environment
python3 -m venv venv
  • Activate the virtual environment in linux or mac
source venv/bin/activate
  • Activate the virtual environment in windows
venv\Scripts\activate
  • Install the dependencies
pip install -r requirements.txt
  • Run the application
uvicorn main:app --reload

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published