PI06 i PI06-1. Docker definitions for MSSQL and Postgres. Data seeder/generator for countries and people. Entity Framework example with variants for Postgres and MSSQL

This commit is contained in:
Boris Milašinović
2026-04-19 16:49:07 +02:00
parent 44a663e170
commit 6f56d107a2
89 changed files with 7305 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
services:
postgres:
image: postgres:18
container_name: postgres_db
restart: unless-stopped
env_file:
- .env
environment:
# custom variables for init scripts (.sh)
APP_DB_USER: ${APP_DB_USER}
APP_DB_PASSWORD: ${APP_DB_PASSWORD}
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- postgres_data:/var/lib/postgresql
- ./backup:/backup
#chmod +x init/01-roles.sh on linux?
- ./init:/docker-entrypoint-initdb.d
# if we need periodic backup
# entrypoint: >
# bash -c "while true; do
# pg_dump -h postgres -U ${POSTGRES_USER} ${POSTGRES_DB} > /backup/backup_$$(date +%Y%m%d_%H%M%S).sql;
# sleep 86400;
# done"
volumes:
postgres_data: