mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-08-15 12:24:55 +08:00
readme: renamed Data store section to Persistence, and moved it to the top
This commit is contained in:
@@ -8,9 +8,9 @@
|
|||||||
- [Reporting Issues](#reporting-issues)
|
- [Reporting Issues](#reporting-issues)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Quick Start](#quick-start)
|
- [Quick Start](#quick-start)
|
||||||
|
- [Persistence](#persistence)
|
||||||
- [Creating User and Database at Launch](#creating-user-and-database-at-launch)
|
- [Creating User and Database at Launch](#creating-user-and-database-at-launch)
|
||||||
- [Creating a Snapshot or Slave Database](#creating-a-snapshot-or-slave-database)
|
- [Creating a Snapshot or Slave Database](#creating-a-snapshot-or-slave-database)
|
||||||
- [Data Store](#data-store)
|
|
||||||
- [Shell Access](#shell-access)
|
- [Shell Access](#shell-access)
|
||||||
- [Upgrading](#upgrading)
|
- [Upgrading](#upgrading)
|
||||||
- [Host UID / GID Mapping](#host-uid--gid-mapping)
|
- [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
|
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
|
# Creating User and Database at Launch
|
||||||
|
|
||||||
The image allows you to create a user and database at launch time.
|
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
|
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)
|
# 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.
|
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user