Minor issues tips & tricks
Too many clients already error in dockerized PSQL database container
To fix this issue:
Stop currently running containers
docker-compose down
ctrl + c if you ran compose without -d flag
Add command: postgres -c 'max_connections=250' to database container definition in docker-compose.yml
Re-run app
docker-compose up -d
You can now investigate how many connections are really needed and lower that value
To investigate how many connections are occupied:
Run app (if you have not started it yet)
docker-compose up -d
List all running containers to get database CONTAINER_ID (it contains postgres in image name)
docker ps
Check database container ip
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' CONTAINER_ID
Connect locally to database container, write container ip in host name input (use database client, I have used dbeaver)
Right click on database/SQL Editor/Open SQL console
To check current connections to database
select * from pg_catalog.pg_stat_activity
OpenLMIS: the global initiative for powerful LMIS software