diff --git a/README.md b/README.md index 3931206..ab239eb 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ - [Reporting Issues](#reporting-issues) - [Installation](#installation) - [Quick Start](#quick-start) +- [Persistence](#persistence) - [Creating User and Database at Launch](#creating-user-and-database-at-launch) - [Creating a Snapshot or Slave Database](#creating-a-snapshot-or-slave-database) -- [Data Store](#data-store) - [Shell Access](#shell-access) - [Upgrading](#upgrading) - [Host UID / GID Mapping](#host-uid--gid-mapping) @@ -85,6 +85,26 @@ The simplest way to login to the postgresql container as the administrative `pos docker exec -it postgresql sudo -u postgres psql ``` +# Persistence + +For data persistence a volume should be mounted at `/var/lib/postgresql`. + +SELinux users are also required to change the security context of the mount point so that it plays nicely with selinux. + +```bash +mkdir -p /opt/postgresql/data +sudo chcon -Rt svirt_sandbox_file_t /opt/postgresql/data +``` + +The updated run command looks like this. + +```bash +docker run --name postgresql -d \ + -v /opt/postgresql/data:/var/lib/postgresql sameersbn/postgresql:9.4-1 +``` + +This will make sure that the data stored in the database is not lost when the image is stopped and started again. + # Creating User and Database at Launch The image allows you to create a user and database at launch time. @@ -170,26 +190,6 @@ docker run --name='psql-slave' -it --rm \ sameersbn/postgresql:latest ``` -# Data Store - -For data persistence a volume should be mounted at `/var/lib/postgresql`. - -SELinux users are also required to change the security context of the mount point so that it plays nicely with selinux. - -```bash -mkdir -p /opt/postgresql/data -sudo chcon -Rt svirt_sandbox_file_t /opt/postgresql/data -``` - -The updated run command looks like this. - -```bash -docker run --name postgresql -d \ - -v /opt/postgresql/data:/var/lib/postgresql sameersbn/postgresql:9.4-1 -``` - -This will make sure that the data stored in the database is not lost when the image is stopped and started again. - # Enable Unaccent (Search plain text with accent) Unaccent is a text search dictionary that removes accents (diacritic signs) from lexemes. It's a filtering dictionary, which means its output is always passed to the next dictionary (if any), unlike the normal behavior of dictionaries. This allows accent-insensitive processing for full text search.