projects/docker-compose.yml

54 lines
1.4 KiB
YAML

version: '3.9'
services:
postgres:
image: pgvector/pgvector:pg17
container_name: postgres_container
environment:
POSTGRES_USER: postgres_user
POSTGRES_PASSWORD: postgres_password
POSTGRES_DB: postgres_db
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "5430:5432"
volumes:
- ./pgdata:/var/lib/postgresql/data/pgdata
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
command: >
postgres -c max_connections=1000
-c shared_buffers=256MB
-c effective_cache_size=768MB
-c maintenance_work_mem=64MB
-c checkpoint_completion_target=0.7
-c wal_buffers=16MB
-c default_statistics_target=100
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres_user -d postgres_db" ]
interval: 30s
timeout: 10s
retries: 5
restart: unless-stopped
tty: true
stdin_open: true
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin4_container
restart: unless-stopped
ports:
- 5016:80
user: "$UID:$GID"
environment:
- PGADMIN_DEFAULT_EMAIL=dtorov@bk.ru
- PGADMIN_DEFAULT_PASSWORD=gjlfhjr
volumes:
- ./pgadmin-data:/var/lib/pgadmin
volumes:
pgdata:
driver: local