-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
34 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "docker/database"] | ||
path = docker/database | ||
url = https://github.com/Banno/docker-postgresql-8.4/ | ||
branch = postgres-8.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,25 @@ | ||
FROM ubuntu | ||
FROM ubuntu:14.04 | ||
|
||
# Add the PostgreSQL PGP key to verify their Debian packages. | ||
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc | ||
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 | ||
RUN apt-get update && apt-get install -y wget | ||
|
||
# Add PostgreSQL's repository. It contains the most recent stable release | ||
# of PostgreSQL, ``9.6``. | ||
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list | ||
ADD pgdg.list /etc/apt/sources.list.d/pgdg.list | ||
This comment has been minimized.
Sorry, something went wrong. |
||
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | ||
|
||
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.6 | ||
# There are some warnings (in red) that show up during the build. You can hide | ||
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6 postgresql-9.6-ip4r | ||
RUN apt-get -qq update && LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive apt-get install -y -q postgresql-8.4 libpq-dev | ||
|
||
# Note: The official Debian and Ubuntu images automatically ``apt-get clean`` | ||
# after each ``apt-get`` | ||
# /etc/ssl/private can't be accessed from within container for some reason | ||
# (@andrewgodwin says it's something AUFS related) | ||
RUN mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private | ||
|
||
# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.6`` package when it was ``apt-get installed`` | ||
USER postgres | ||
## Add over config files | ||
ADD postgresql.conf /etc/postgresql/8.4/main/postgresql.conf | ||
ADD pg_hba.conf /etc/postgresql/8.4/main/pg_hba.conf | ||
RUN chown postgres:postgres /etc/postgresql/8.4/main/*.conf | ||
ADD init-postgresql /usr/local/bin/init-postgresql | ||
RUN chmod +x /usr/local/bin/init-postgresql | ||
|
||
# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and | ||
# then create a database `docker` owned by the ``docker`` role. | ||
# Note: here we use ``&&\`` to run commands one after the other - the ``\`` | ||
# allows the RUN command to span multiple lines. | ||
RUN /etc/init.d/postgresql start &&\ | ||
psql --command "CREATE USER wlansi_cms WITH SUPERUSER PASSWORD 'mainpage';" &&\ | ||
psql -d template1 -c 'create extension ip4r;' &&\ | ||
createdb -O wlansi_cms wlansi | ||
|
||
# Adjust PostgreSQL configuration so that remote connections to the | ||
# database are possible. | ||
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.6/main/pg_hba.conf | ||
|
||
# And add ``listen_addresses`` to ``/etc/postgresql/9.6/main/postgresql.conf`` | ||
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.6/main/postgresql.conf | ||
|
||
# Expose the PostgreSQL port | ||
VOLUME ["/var/lib/postgresql"] | ||
EXPOSE 5432 | ||
|
||
# Add VOLUMEs to allow backup of config, logs and databases | ||
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"] | ||
CMD ["/usr/local/bin/init-postgresql"] | ||
|
||
# Set the default command to run when starting the container | ||
CMD ["/usr/lib/postgresql/9.6/bin/postgres", "-D", "/var/lib/postgresql/9.6/main", "-c", "config_file=/etc/postgresql/9.6/main/postgresql.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why is this file not in repository? Also init-postgresql