I have too many connection open using the default docker postgresql
configuration
I want to extend max_connection
without using a volume for mounting the configuration (I need this to be available by default for my CI environment).
I have tried to use sed
to edit the configuration but this has no effect.
What is the recommended way of overriding default configuration of postgresql docker official image?
The default postgresql. conf file lives within the PGDATA dir ( /var/lib/postgresql/data ), which makes things more complicated especially when running the Postgres container for the first time, since the docker-entrypoint.sh wrapper invokes the initdb step for PGDATA dir initialization.
max_connections ( integer ) Determines the maximum number of concurrent connections to the database server. The default is typically 100 connections, but might be less if your kernel settings will not support it (as determined during initdb). This parameter can only be set at server start.
run this docker-compose.yml
version: '2' services: postgres: image: postgres:10.3-alpine command: postgres -c 'max_connections=200' environment: POSTGRES_DB: pgdb POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres stdin_open: true tty: true ports: - 5432:5432/tcp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With