https://github.com/piccolo-orm/piccolo_docker
Easily spin up databases for your Piccolo project using Docker
https://github.com/piccolo-orm/piccolo_docker
Last synced: 9 months ago
JSON representation
Easily spin up databases for your Piccolo project using Docker
- Host: GitHub
- URL: https://github.com/piccolo-orm/piccolo_docker
- Owner: piccolo-orm
- License: mit
- Created: 2021-09-13T09:57:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-25T06:01:32.000Z (over 4 years ago)
- Last Synced: 2025-03-28T19:44:39.617Z (9 months ago)
- Language: Python
- Size: 84 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## piccolo_docker
Easily spin up databases for your Piccolo project using Docker
### Requirements
- [Install poetry](https://python-poetry.org/docs/#installation)
- [Install docker](https://docs.docker.com/get-docker/)
### Setup
- Clone this repo
- Open `.env`
- Add database name
- Add password. If you don't a random password will be generated that can be seen with `docker inspect --format="{{index .Config.Env 0}}" your_container_name`
- Change the unique container name if you don't want to use the default
- To add use this app to your Piccolo project, add it to your `AppRegistry` in `piccolo_conf.py` with: `APP_REGISTRY = AppRegistry(apps=["piccolo_docker.user.piccolo_app"])`
### Usage
- `piccolo dockerdb create`
creates new postgres container with your piccolo database.
- `piccolo dockerdb stop`
stops the docker container.
- `piccolo dockerdb start`
starts the docker container.
- `piccolo dockerdb destroy`
destroys the docker container. This is irreversible.
### Tests
Simply run:
`pytest -vv tests/`
For the `nox` tests you'll probably need pyenv and all versions of python that are declared inside `noxfile.py`
### Improvements
- Test against multiple versions of postgres
- Test against more versions of python.
### To Contribute
- Fork the repo
- Have a look around
- Make sure you install [pre-commit](https://pre-commit.com/)
- Do a small PR for early feedback
- Enjoy!