anomaly / lab-python-server

A template for building containerised web applications in Python with a recommended set o f dependencies and tooling
Apache License 2.0
11 stars 2 forks source link

Document how alembic is run in production via the containers #45

Open devraj opened 1 year ago

devraj commented 1 year ago

Extending #44 we should define how alembic is configured in the production container and how you are expected to run the migration in production environments.

We should also think about providing Task based scripts, Tasks is available as a Github action which would work well with the proposed CI/CD workflow.

devraj commented 11 months ago

I was making some headway on this on a client's project that uses this template. My initial approach was to make a Taskfile that would be suitable for production and make available a subset of operations like:

Debian does not have an official go-task package but Apline linux does. These are the two Linux flavours published by the official Python base image.

Shifting to Apline would mean a massive move away from our general toolkit.

People have workarounds using tools like pacstall (in this instance on Ubuntu). Before we can provide this as part of the template we would have to figure out how we install task on Debian.

Failing everything task provides a binary

sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d

We already have curl available on the pods to assist with other actions. I have tested this on our current images.