Add PostgreSQL configuration
This commit is contained in:
parent
d919ed95b8
commit
05465f548a
3 changed files with 72 additions and 41 deletions
49
.env.example
49
.env.example
|
|
@ -20,49 +20,16 @@ EMAIL_HOST_PASSWORD=your-app-password-here
|
||||||
# Connection security
|
# Connection security
|
||||||
# Use TLS (True for most providers like Gmail, Outlook)
|
# Use TLS (True for most providers like Gmail, Outlook)
|
||||||
EMAIL_USE_TLS=True
|
EMAIL_USE_TLS=True
|
||||||
# Use SSL (False for most providers, True for some like older configurations)
|
# Use SSL (False for most providers, True for some older configurations)
|
||||||
EMAIL_USE_SSL=False
|
EMAIL_USE_SSL=False
|
||||||
|
|
||||||
# Connection timeout in seconds
|
# Connection timeout in seconds
|
||||||
EMAIL_TIMEOUT=10
|
EMAIL_TIMEOUT=10
|
||||||
|
|
||||||
# Common SMTP Provider Examples:
|
# PostgreSQL Configuration
|
||||||
#
|
POSTGRES_PASSWORD=your-postgres-password-here
|
||||||
# Gmail:
|
POSTGRES_USER=ttvdrops
|
||||||
# EMAIL_HOST=smtp.gmail.com
|
POSTGRES_DB=ttvdrops
|
||||||
# EMAIL_PORT=587
|
# PostgreSQL Host and Port
|
||||||
# EMAIL_USE_TLS=True
|
POSTGRES_HOST=localhost
|
||||||
# EMAIL_USE_SSL=False
|
POSTGRES_PORT=5432
|
||||||
# Note: Requires App Password with 2FA enabled
|
|
||||||
#
|
|
||||||
# Outlook/Hotmail:
|
|
||||||
# EMAIL_HOST=smtp-mail.outlook.com
|
|
||||||
# EMAIL_PORT=587
|
|
||||||
# EMAIL_USE_TLS=True
|
|
||||||
# EMAIL_USE_SSL=False
|
|
||||||
#
|
|
||||||
# Yahoo:
|
|
||||||
# EMAIL_HOST=smtp.mail.yahoo.com
|
|
||||||
# EMAIL_PORT=587
|
|
||||||
# EMAIL_USE_TLS=True
|
|
||||||
# EMAIL_USE_SSL=False
|
|
||||||
#
|
|
||||||
# SendGrid:
|
|
||||||
# EMAIL_HOST=smtp.sendgrid.net
|
|
||||||
# EMAIL_PORT=587
|
|
||||||
# EMAIL_USE_TLS=True
|
|
||||||
# EMAIL_USE_SSL=False
|
|
||||||
# EMAIL_HOST_USER=apikey
|
|
||||||
# EMAIL_HOST_PASSWORD=your-sendgrid-api-key
|
|
||||||
#
|
|
||||||
# Mailgun:
|
|
||||||
# EMAIL_HOST=smtp.mailgun.org
|
|
||||||
# EMAIL_PORT=587
|
|
||||||
# EMAIL_USE_TLS=True
|
|
||||||
# EMAIL_USE_SSL=False
|
|
||||||
#
|
|
||||||
# Amazon SES:
|
|
||||||
# EMAIL_HOST=email-smtp.us-east-1.amazonaws.com
|
|
||||||
# EMAIL_PORT=587
|
|
||||||
# EMAIL_USE_TLS=True
|
|
||||||
# EMAIL_USE_SSL=False
|
|
||||||
45
compose.yaml
Normal file
45
compose.yaml
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
services:
|
||||||
|
ttvdrops_postgres:
|
||||||
|
image: postgres:17-bookworm
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: ttvdrops
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?You must set POSTGRES_PASSWORD}
|
||||||
|
POSTGRES_DB: ttvdrops
|
||||||
|
PGDATA: /data
|
||||||
|
command: postgres -c config_file=/config/postgresql.conf
|
||||||
|
shm_size: 5g
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready", "-d", "ttvdrops", "-U", "ttvdrops"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 60s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- ttvdrops
|
||||||
|
volumes:
|
||||||
|
- /mnt/Docker/Data/ttvdrops/postgresql/data:/data
|
||||||
|
- /mnt/Docker/Data/ttvdrops/postgresql/config:/config
|
||||||
|
|
||||||
|
ttvdrops_pgbouncer:
|
||||||
|
image: edoburu/pgbouncer
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- ttvdrops_postgres
|
||||||
|
ports:
|
||||||
|
- "6432:6432"
|
||||||
|
environment:
|
||||||
|
DB_USER: ttvdrops
|
||||||
|
DB_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
DB_HOST: ttvdrops_postgres
|
||||||
|
DB_NAME: ttvdrops
|
||||||
|
POOL_MODE: transaction
|
||||||
|
MAX_CLIENT_CONN: 200
|
||||||
|
DEFAULT_POOL_SIZE: 20
|
||||||
|
networks:
|
||||||
|
- ttvdrops
|
||||||
|
|
||||||
|
networks:
|
||||||
|
ttvdrops:
|
||||||
19
postgresql.conf
Normal file
19
postgresql.conf
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
checkpoint_completion_target = 0.9
|
||||||
|
default_statistics_target = 100
|
||||||
|
effective_cache_size = 12GB
|
||||||
|
effective_io_concurrency = 200
|
||||||
|
huge_pages = off
|
||||||
|
listen_addresses = '*'
|
||||||
|
maintenance_work_mem = 1GB
|
||||||
|
max_connections = 50
|
||||||
|
max_parallel_maintenance_workers = 4
|
||||||
|
max_parallel_workers = 12
|
||||||
|
max_parallel_workers_per_gather = 4
|
||||||
|
max_wal_size = 4GB
|
||||||
|
max_worker_processes = 12
|
||||||
|
min_wal_size = 1GB
|
||||||
|
random_page_cost = 1.1
|
||||||
|
shared_buffers = 4GB
|
||||||
|
superuser_reserved_connections = 3
|
||||||
|
wal_buffers = 16MB
|
||||||
|
work_mem = 19784kB
|
||||||
Loading…
Add table
Add a link
Reference in a new issue