JeremyAndress / fastapi-docker

Docker image with FastAPI with users management, ready for production :rocket:
MIT License
30 stars 8 forks source link
backend docker fastapi fastapi-docker mysql openapi postgres postgresql python swagger-ui

FastAPI Docker :rocket:

Test license Profile

Features :sparkles:

Requirements :pushpin:

Quick Start :seedling:

Run FastAPI Docker :zap: Local Development

  1. git clone https://github.com/JeremyAndress/fastapi-docker.git
  2. Create .env files cp .env.example .env

You should now have a directory structure like:

.
├── compose
│   ├── local
│   ├── production
│   ├── scripts
│   └── stage
├── nginx
│   └── site.conf
├── requirements
│   ├── local.txt
│   ├── migrations.txt
│   ├── mysql.txt
│   ├── postgre.txt
│   ├── production.txt
│   └── test.txt
├── screenshots
│   └── ui.png
├── src
│   ├── alembic
│   ├── api
│   ├── core
│   ├── db
│   ├── logs
│   ├── models
│   ├── __pycache__
│   ├── schemas
│   ├── tests
│   ├── utils
│   ├── alembic.ini
│   ├── main.py
│   ├── pre_start.py
│   └── prestart.sh
├── CHANGELOG.md
├── LICENSE
├── .env.example
├── .flake8
├── local.yml
├── production.yml
├── pytest.ini
├── README.md
└── stage.yml
  1. docker-compose -f local.yml build
  2. docker-compose -f local.yml up -d
  3. That's just all, api server is listen at http://localhost:8030/docs now

You will see the automatic interactive API documentation (provided by Swagger UI): Swagger UI

Testing :rotating_light:

    pytest -vvs src/tests/