提问者:小点点

如何从Postgres docker映像更改postgresql. conf


我有一个使用Docker容器部署的Rails应用程序。我正在使用PostgreSQL作为数据库,我正在尝试设置WAL-E以对S3存储桶进行持续备份。为此设置涉及对postgresql. conf文件进行一些更改。

我使用postgres官方镜像作为基本镜像,并传入postgresql. conf文件。这是我的Dockerfile:

FROM postgres:9.4
MAINTAINER David Ham <me@example.com>

RUN apt-get update -y && apt-get install -y \
    git \
    python-virtualenv \
    python-dev \
    python-pip \
    libevent-dev \
    pv \
    lzop

RUN virtualenv /opt/wale \
    && . /opt/wale/bin/activate \
    && pip install git+https://github.com/wal-e/wal-e

COPY postgresql.conf /postgresql-wal-e/postgresql-wal-e.conf

RUN chown -R postgres:postgres /postgresql-wal-e

CMD ["postgres", "-c", "config-file=/postgresql-wal-e/postgresql-wal-e.conf"]

这是正确的吗?它似乎已经正确复制,但这是正确的方式来配置Postgres与他们的官方形象吗?


共1个答案

匿名用户

是的,您的配置方式应该有效。

您可以在回答此问题时找到其他方法如何自定义官方PostgreSQL Docker映像的配置文件?