Creates a new Docker image based on Postgres:14.7 and adds pg_cron
support. The logic is the same for almost all Postgres versions. You could use it with Postgres-13, Postgres-15 as well. Don't forget to change Postgres version numbers in Dockerfile
, and build.sh
.
- clone the repo
- use
build.sh
to create the image - create an
.env
file along withdocker-compose.yml
- add
POSTGRES_CRON_DB=cron_db_name
to the.env
- add
POSTGRES_CRON_DB
to the environment section indocker-compose.yml
- refer to the image in
docker-compose.yml
version: '3.6'
services:
postgres:
image: postgres_cron:14.7
...
...
..
environment:
POSTGRES_CRON_DB: ${POSTGRES_CRON_DB}
- run
docker-compose up -d
- create an
.env
file along withdocker-compose.yml
- add
POSTGRES_CRON_DB=cron_db_name
to the.env
- add
POSTGRES_CRON_DB
to the environment section indocker-compose.yml
- refer to the image in
docker-compose.yml
version: '3.6'
services:
postgres:
image: ghcr.io/circleboom/docker-postgres-14-with-pg_cron
...
...
..
environment:
POSTGRES_CRON_DB: ${POSTGRES_CRON_DB}
Thanks to: