From db2da67ee4f933ab332709bf1f52f401579030da Mon Sep 17 00:00:00 2001 From: TrisNol Date: Fri, 11 Aug 2023 15:55:54 +0200 Subject: [PATCH] docs: Add reference on how to use secrets.json --- CONTRIBUTING.md | 24 ++++++++++++++++++++++++ docker-compose.yml | 18 ++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4bfddee..553d4c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,3 +34,27 @@ We decided to use english on everything close to code but will write longer text - Secret detection - python normen ([pep8](https://peps.python.org/pep-0008/)) with [flake8](https://flake8.pycqa.org/en/latest/) - type checking with ([mypy](https://github.com/python/mypy)) + +## Setup + +### Connection strings +Create a `secrets.json` in the root of this repo with the following structure (values to be replaces by desired config): +```json + { + "postgres": { + "username": "postgres", + "password": "postgres", + "host": "localhost", + "database": "postgres", + "port": 5432 + }, + "mongo": { + "username": "username", + "password": "password", + "host": "localhost", + "database": "transparenzregister", + "port": 27017 + } + } +``` +Example usage see [connector.py](./src/aki_prj23_transparenzregister/utils/postgres/connector.py) diff --git a/docker-compose.yml b/docker-compose.yml index 557b8fe..c7efb62 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,5 +5,23 @@ services: restart: always environment: POSTGRES_PASSWORD: postgres + volumes: + - postgres_data:/var/lib/postgresql/data ports: - 5432:5432 + mongodb: + image: mongo:4.4.6 + container_name: mongodb + restart: unless-stopped + environment: + MONGO_INITDB_ROOT_USERNAME: username + MONGO_INITDB_ROOT_PASSWORD: password + MONGO_INITDB_DATABASE: transparenzregister + ports: + - 27017:27017 + volumes: + - mongo_data:/data/db + +volumes: + postgres_data: + mongo_data: