This repository contains the Dockerfile for PostgreSQL for Docker's automated build published to the public Docker Hub Registry.
This PostgreSQL has been extended and optimized for use with the Nuclos application server container.
Base Docker Image
You can run a Nuclos-DB container with the following command. E.g.:
docker run --name nuclos-db-9.6 -d nuccess/nuclos-db:9.6
(alternatively, you can build an image from Dockerfile:
docker build -t="nuccess/nuclos-db" https://bitbucket.org/nuccess/docker-nuclos-db.git)
docker run --name nuclos-db-9.6 -e TZ=Europe/Berlin -e LOCALE=de_DE.UTF-8 -p 5496:5432 -d nuccess/nuclos-db:9.6
This directory acts as an interface for a Nuclos application server container. New files in this directory are automatically processed by the server container. You can also use this function to import or export a database dump (created with pg_dump). No need to install a PostgreSQL client on your host system or to connect to the container directly.
To access this volume from your host system, just mount it to a local directory using following command. E.g.
Import a dump (pg_dump format)
- Copy the dump to the subdirectory
/var/nuclos-db/backups. The name of the dump file must ensure following naming convention:
schema#tag.backup(schema: The schema is then automatically created. If it already exists, it will be dropped before creating it again. tag: Name or timestamp, only to identify a dump). Example: myerp#2017-05-01.backup
- To instruct the container to import the dump, create a simple file
schema#tag.impin /var/nuclos-db, which is then automatically interpreted as a command. Example:
echo "FileContentDoesNotMatter" > /Users/Maik/Nuclos/Docker/vol-nuclos-db-9.6/myerp#2017-05-01.imp(the mounted directory as explained in section "Data Volume").
- Once the import is completed, the recently created "command file" e.g. myerp#2017-05-01.imp will be deleted automatically.
Export a schema (pg_dump format)
- Create a simple file
schema#tag.expin /var/nuclos-db. Example:
echo "FileContentDoesNotMatter" > /Users/Maik/Nuclos/Docker/vol-nuclos-db-9.6/myerp#2017-05-15.exp(the mounted directory as explained in section "Data Volume").
- Once the export is completed, this "command file" is deleted automatically. The exported dump will be stored in the subdirectory named
- Save your SQL commands in one single file. Use the file name extension .sql and copy it to var/nuclos-db
Set the timezone. Default is Europe/Berlin.
Set the locale. Default is de_DE.UTF-8.
The default PostgreSQL account is
nuclos with password
password. You can change the default password with this variable.
Set total usable RAM for the PostgreSQL process. Default is 1 GB.
PostgreSQL database connection limit. Default is 50. We recommend 50 connections per active Nuclos application server.