How to customize the configuration file of the official PostgreSQL Docker image?

后端 未结 11 2060
时光取名叫无心
时光取名叫无心 2020-11-29 16:11

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

11条回答
  •  渐次进展
    2020-11-29 16:36

    Using docker compose you can mount a volume with postgresql.auto.conf. Example:

    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
    

提交回复
热议问题