[hw-4] add postgres db

This commit is contained in:
Никита Шубин
2025-06-26 12:08:46 +00:00
parent 3ebaad5558
commit 77ed9fcf85
46 changed files with 1582 additions and 369 deletions

View File

@@ -17,7 +17,43 @@ services:
build:
context: .
dockerfile: loms/Dockerfile
depends_on:
- postgres-master
ports:
- "8083:8083"
- "8084:8084"
- "8085:8085"
postgres-master:
image: gitlab-registry.ozon.dev/go/classroom-18/students/base/postgres:16
container_name: postgres-master
environment:
- POSTGRESQL_USERNAME=user
- POSTGRESQL_PASSWORD=password
- POSTGRESQL_DATABASE=route256
- POSTGRESQL_REPLICATION_MODE=master
- POSTGRESQL_REPLICATION_USER=repl_user
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
- POSTGRESQL_SYNCHRONOUS_COMMIT_MODE=on
- POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS=1
ports:
- "5433:5432"
postgres-replica:
image: gitlab-registry.ozon.dev/go/classroom-18/students/base/postgres:16
container_name: postgres-replica
depends_on:
- postgres-master
environment:
- POSTGRESQL_DATABASE=route256
- POSTGRESQL_USERNAME=user
- POSTGRESQL_PASSWORD=password
- POSTGRESQL_REPLICATION_MODE=slave
- POSTGRESQL_REPLICATION_USER=repl_user
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
- POSTGRESQL_MASTER_HOST=postgres-master
- POSTGRESQL_MASTER_PORT_NUMBER=5432
- POSTGRESQL_SYNCHRONOUS_COMMIT_MODE=on
- POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS=1
ports:
- "5434:5432"