Готовая конфигурация для postgres

This commit is contained in:
2025-08-20 23:25:02 +07:00
commit 9b617ebc6d
5 changed files with 14095 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
pgdata/

23
docker-compose.yml Normal file
View File

@@ -0,0 +1,23 @@
version: '3.8'
networks:
postgres-network:
name: postgres-network
driver: bridge
services:
postgres:
image: postgres:17
networks:
- postgres-network
container_name: shared-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5432:5432"
volumes:
- ./pgdata:/var/lib/postgresql/data
- ./init:/docker-entrypoint-initdb.d:ro
restart: unless-stopped

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

39
init/init.sql Normal file
View File

@@ -0,0 +1,39 @@
ALTER USER postgres WITH PASSWORD 'postgres';
CREATE ROLE discord_economy_bot WITH
LOGIN
NOSUPERUSER
NOCREATEDB
NOCREATEROLE
INHERIT
REPLICATION
NOBYPASSRLS
CONNECTION LIMIT -1
PASSWORD 'economy_bot';
CREATE DATABASE discord_economy_bot_db
WITH
OWNER = discord_economy_bot
ENCODING = 'UTF8'
LOCALE_PROVIDER = 'libc'
CONNECTION LIMIT = -1
IS_TEMPLATE = False;
CREATE ROLE discord_moderation_bot WITH
LOGIN
NOSUPERUSER
NOCREATEDB
NOCREATEROLE
INHERIT
REPLICATION
NOBYPASSRLS
CONNECTION LIMIT -1
PASSWORD 'moderation_bot';
CREATE DATABASE discord_moderation_bot_db
WITH
OWNER = discord_moderation_bot
ENCODING = 'UTF8'
LOCALE_PROVIDER = 'libc'
CONNECTION LIMIT = -1
IS_TEMPLATE = False;