Postgresql 如何更改设置上的postgres docker图像级别?

Postgresql 如何更改设置上的postgres docker图像级别?,postgresql,docker,docker-compose,Postgresql,Docker,Docker Compose,我正在为我的一个应用程序使用postgres:11.6-alpine图像,我想在设置时将图像wal_级别设置为“逻辑”,最好使用docker compose 我找到的解决方案需要您覆盖postgresql.conf图像。但是,我不想为了更改此设置而拥有完整的postgresql.conf文件 有什么方法可以做到这一点吗?像这样更新PostgreSQL容器配置的命令部分 services: postgres: image: postgres:11.6-alpine ports:

我正在为我的一个应用程序使用postgres:11.6-alpine图像,我想在设置时将图像wal_级别设置为“逻辑”,最好使用docker compose

我找到的解决方案需要您覆盖postgresql.conf图像。但是,我不想为了更改此设置而拥有完整的postgresql.conf文件


有什么方法可以做到这一点吗?

像这样更新PostgreSQL容器配置的
命令部分

services:
  postgres:
    image: postgres:11.6-alpine
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_DB=my_db
      - POSTGRES_PASSWORD=changeme
    command:
      - "postgres"
      - "-c"
      - "wal_level=logical"

如果你喜欢这种格式

    command: [ "postgres", "-c", "wal_level=logical" ]