GithubHelp home page GithubHelp logo

mybigman / starlite-pg-redis-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from litestar-org/litestar-pg-redis-docker

1.0 0.0 0.0 330 KB

Example Starlite project using Postgresql, Redis and Docker

License: MIT License

Shell 2.24% Python 95.33% Mako 0.73% Dockerfile 1.70%

starlite-pg-redis-docker's Introduction

Starlite logo

starlite-pg-redis-docker

A WIP Starlite API Implementation.

TODO

Starlite

Starlite is a light and flexible ASGI API framework.

Starlite documentation ๐Ÿ“š

RestartableUvicornWorker

There is a known issue when running gunicorn with uvicorn workers, see here.

For convenience an implementation of the workaround (this one) suggested in that gunicorn issue is included in the application source.

To use the included RestartableUvicornWorker set the GUNICORN_WORKER_CLASS env var to app.utils.restartable_worker.RestartableUvicornWorker.

In production, set the GUNICORN_WORKER_CLASS env var to uvicorn.workers.UvicornWorker as advised here.

Setup

  • $ cp .env.example .env
  • $ docker-compose run --rm app alembic upgrade head

Run

$ docker-compose up --build

ReDoc

http://localhost:8000/schema

Test

$ docker-compose run --rm app scripts/tests

Format

black

$ docker-compose run --rm app black .

isort

$ docker-compose run --rm app isort .

Add Dependencies

Production

$ docker-compose run --rm app poetry add <dependency>

Dev

$ docker-compose run --rm app poetry add <dependency> --dev

Rebuild

$ docker-compose build

Migrations

Ensure the database service is up

$ docker-compose up -d db

Revision

$ docker-compose run --rm app alembic revision --autogenerate -m "revision description"

May have issue with permissions after having docker generate the revision file, to fix:

$ sudo chown <user> ./alembic/versions/<filename>.py

Migration

$ docker-compose run --rm app alembic upgrade head

starlite-pg-redis-docker's People

Contributors

goldziher avatar peterschutt avatar sondrelg avatar yudjinn avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.