docs: Add reference on how to use secrets.json

This commit is contained in:
TrisNol 2023-08-11 15:55:54 +02:00
parent 1ca1985f57
commit db2da67ee4
2 changed files with 42 additions and 0 deletions

View File

@ -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)

View File

@ -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: