mirror of
https://github.com/EDeev/mobiles_dataset.git
synced 2026-10-07 20:49:44 +03:00
docker-compose: PostgreSQL 15 со схемой курсовой и ролью по умолчанию для локального запуска
This commit is contained in:
parent
891a0e9a3c
commit
2c26b2fe65
2 changed files with 22 additions and 0 deletions
20
compose.yaml
Normal file
20
compose.yaml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Локальный PostgreSQL 15 со схемой курсовой: docker compose up -d
|
||||
services:
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./docker/00-roles.sql:/docker-entrypoint-initdb.d/00-roles.sql:ro
|
||||
- ./sql/create_schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d mobile_devices_db"]
|
||||
interval: 5s
|
||||
retries: 20
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
2
docker/00-roles.sql
Normal file
2
docker/00-roles.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
-- Роль приложения для локального стенда (значения по умолчанию из database.py)
|
||||
CREATE ROLE admin LOGIN SUPERUSER PASSWORD 'password';
|
||||
Loading…
Add table
Reference in a new issue