7

I have a Rails app that I'm deploying using Docker containers. I'm using PostgreSQL for the database, and I'm trying to set up WAL-E to do continuous backups to an S3 bucket. The setup for this involves making a few changes to the postgresql.conf file.

I am using a postgres official image as a base image, and am passing in a postgresql.conf file. Here is my Dockerfile:

FROM postgres:9.4
MAINTAINER David Ham <[email protected]>

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"]

Is this right? It seems to have copied in correctly, but is this the right way to configure Postgres with their official images?

2
  • 1
    Possible duplicate of How to customize the configuration file of the official PostgreSQL docker image? Commented Feb 9, 2017 at 11:01
  • can you keep a file besides your docker image 'postgresql.cnf', which will contain changes you needed, and once the installation of postgres is complete then can you COPY that file to desired (/var/lib/postgres/data/) folder? Commented Aug 28, 2017 at 7:11

1 Answer 1

-1

yes, your way to configure should work.

you can find other ways in answers of this question How to customize the configuration file of the official PostgreSQL Docker image?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.