I\'m using the official Postgres Docker image trying to customize its configuration. For this purpose, I use the command sed to change max_connections
sed
max_connections
Using docker compose you can mount a volume with postgresql.auto.conf. Example:
postgresql.auto.conf
version: '2' services: db: image: postgres:10.9-alpine volumes: - postgres:/var/lib/postgresql/data:z - ./docker/postgres/postgresql.auto.conf:/var/lib/postgresql/data/postgresql.auto.conf ports: - 5432:5432