Mycro Services
Backend

Getting started

Same as for frontend, Notice the Dockerfile at the root folder. It is a multi stage Dockerfile that build a dev and a prod version of the app.

You can start the backend right away with:

  • uvicorn app.main:app --host 0.0.0.0 --port 5005 --reload or
  • python3 -m poetry run uvicorn app.main:app --reload --host 127.0.0.1 --port 5005

Dev

  • First, build your docker image: docker build --target dev -t ze-backend-dev .

  • Then run the container docker run -p 5005:5005 ze-backend-dev

    • Hot reload on code changes. • Dev tools installed.

Production

  • First, build your production docker image: docker build --target production -t ze-backend-prod .

  • Then run the container docker run -p 5005:5005 ze-backend-prod

    • Small, clean image. • No reload, no dev deps. • Non-root user for security.

PostgreSQL

The database.py file is the backbone for your PostgreSQL database. You can then go to the folder /dband add the classes and tables and logic for your database.