Skip to content

Repository files navigation

PostgreSQL Docker Container Image

Build StatusDocker PullsDocker Stars

Docker Images

❗For better reliability we release images with stability tags (wodby/postgres:18-X.X.X) which correspond to git tags. We strongly recommend using images only with stability tags.

Overview:

Supported tags and respective Dockerfile links:

All images built for linux/amd64 and linux/arm64

PostGIS Tags

Plain tags (18, 17, and so on) stay lean and do not include PostGIS.

PostGIS tags (18-postgis, 17-postgis, and so on) bundle PostGIS and default POSTGRES_DB_EXTENSIONS to:

postgis,postgis_raster,postgis_sfcgal,fuzzystrmatch,address_standardizer,address_standardizer_data_us,postgis_tiger_geocoder,postgis_topology

That means a container started from wodby/postgres:18-postgis or wodby/postgres:postgis will create the PostGIS extension set during initialization by default.

To override the default set:

docker run --rm \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB_EXTENSIONS=postgis \
wodby/postgres:18-postgis

Bundled PostGIS versions for the *-postgis tags:

  • PostgreSQL 14-17: PostGIS 3.5.7
  • PostgreSQL 18: PostGIS 3.6.4

Environment Variables

VariableDefault ValueDescription
POSTGRES_CHECKPOINT_COMPLETION_TARGET0.7
POSTGRES_CHECKPOINT_SEGMENTS32<=9.4
POSTGRES_DATESTYLEiso, mdy
POSTGRES_DBpostgres
POSTGRES_DEFAULT_STATISTICS_TARGET100
POSTGRES_DEFAULT_TEXT_SEARCH_CONFIGpg_catalog.english
POSTGRES_EFFECTIVE_CACHE_SIZE1GB
POSTGRES_DB_EXTENSIONSSeparated by comma
POSTGRES_LC_MESSAGESen_US.utf8
POSTGRES_LC_MONETARYen_US.utf8
POSTGRES_LC_NUMERICen_US.utf8
POSTGRES_LC_TIMEen_US.utf8
POSTGRES_LOG_TIMEZONEUTC
POSTGRES_MAINTENANCE_WORK_MEM128MB
POSTGRES_MAX_CONNECTIONS100
POSTGRES_MAX_WAL_SIZE2GB>=9.5
POSTGRES_MIN_WAL_SIZE1GB>=9.5
POSTGRES_SHARED_BUFFERS512MB
POSTGRES_SHARED_MEMORY_TYPEposix>=9.4
POSTGRES_TIMEZONEUTC
POSTGRES_PASSWORDREQUIRED
POSTGRES_USERpostgres
POSTGRES_WAL_BUFFERS16MB
POSTGRES_WORK_MEM5MB

Orchestration Actions

Usage:

make COMMAND [params ...]
commands:
import source=</path/to/dump.zip or http://example.com/url/to/dump.sql.gz> [user password db host binary] backup filepath=</path/to/backup.sql.gz> [user password host db ignore=<"table1;table2"> nice ionice] query query=<SELECT 1> [user password db host] query-silent query=<SELECT 1> [user password db host]
create-db name enconding lc_collate lc_ctype
also creates a schema with the same name inside the database
drop-db name
drops the database; the same-name schema is removed with it
create-user username password
drop-user username
grant-user-db username db
also grants access to the same-name schema inside that database
and sets the user's search_path for that database to "<db>", public
revoke-user-db username db
also revokes access to the same-name schema inside that database
and resets the user's search_path for that database
check-ready [user password db host max_try wait_seconds delay_seconds] default params values:
user $POSTGRES_USER
password $POSTGRES_PASSWORD
db $POSTGRES_DB
host localhost
max_try 1
wait_seconds 1
delay_seconds 0
ignore ""
binary 0
nice 10
ionice 7 

create-user is safe to retry when the existing role accepts the requested password, but fails on a same-named role with different credentials rather than replacing it.

Deployment

Deploy PostgreSQL to your server via Wodby Wodby.

About

PostgreSQL docker container image

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages