my docker-compose.yaml < /p>
Код: Выделить всё
services:
postgres:
env_file: .env
image: 'postgres:latest'
container_name: general_postgres
environment:
POSTGRES_USER: postgres_user
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: postgres_db
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- '5050:5432'
volumes:
- './pgdata:/var/lib/postgresql/data/pgdata'
deploy:
resources:
limits:
cpus: '0.50'
memory: 1024M
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
-c password_encryption=scram-sha-256
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
< /code>
docker compose logs < /p>
general_postgres | mkdir: cannot create directory ‘/var/lib/postgresql/data’: Permission denied
general_postgres exited with code 1 (restarting)
general_postgres | mkdir: cannot create directory ‘/var/lib/postgresql/data’: Permission denied
general_postgres exited with code 1 (restarting)
general_postgres | mkdir: cannot create directory ‘/var/lib/postgresql/data’: Permission denied
general_postgres exited with code 1 (restarting)
general_postgres | mkdir: cannot create directory ‘/var/lib/postgresql/data’: Permission denied
Обновление: я нашел версию прошлых Postgres in env, используя изображение Docker LS и история изображений Docker-no-trunk . Это было 17,6-1.pgdg13+1
Подробнее здесь: https://stackoverflow.com/questions/797 ... e-database
Мобильная версия