You need pyenv and poetry available in development environment.
- Setup Python version specified in
.python-version
pyenv install
- Prepare virtual environment with required dependencies and activate it
poetry install
poetry shell
- Setup pre-commit git hooks to automate code quality check
poetry run pre-commit install
- Create
.env
and specify arguments
cp .env.example
- Run migrations
alembic upgrade head
- Run app
On a localhost
python -m custody
Or in a container
docker compose up
- Load environment variables
export $(cat .env | xargs)
- Deploy stack to Docker Swarm cluster
docker stack deploy -c docker-compose.yml -c docker-compose.prod.yml <stack_name>
ANSIBLE_CONFIG=/path/to/ansible.cfg ansible-playbook -i /path/to/hosts.yml deploy.yml