11notes/postgres
PostgreSQL for Docker
What can I do with this? This image will run postgres as postgres with the database postgres and the password you set initially. Why so simple? Because 99.9% of all containers that need postgres, are happy with the default settings, no different dbname, different dbuser, whatever needed. It also adds a simple backup
command to backup the entire database.
name: "postgres"
services:
postgres:
image: "11notes/postgres:16"
container_name: "postgres"
environment:
TZ: "Europe/Zurich"
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432/tcp"
volumes:
- "etc:/postgres/etc"
- "var:/postgres/var"
- "sql:/postgres/sql"
- "backup:/postgres/backup"
restart: "always"
volumes:
etc:
var:
sql:
backup:
To take a full backup simply run
docker exec postgres backup
Parameter | Value | Description |
---|---|---|
user | docker | user docker |
uid | 1000 | user id 1000 |
gid | 1000 | group id 1000 |
home | /postgres | home directory of user docker |
config | /postgres/etc/default.conf | default configuration file |
Parameter | Value | Default |
---|---|---|
TZ | Time Zone | |
DEBUG | Show debug information | |
POSTGRES_PASSWORD | password for user postgres | |
POSTGRES_SQL_GUACAMOLE | Initialize database for Guacamole |
This image is provided to you at your own risk. Always make backups before updating an image to a new version. Check the changelog for breaking changes. You can find all my repositories on github.
docker pull 11notes/postgres