# Start from your desired Postgres version FROM postgres:17.2 # Install the pg_cron package that matches your Postgres major version RUN apt-get update && \ apt-get install -y postgresql-17-cron && \ rm -rf /var/lib/apt/lists/* # Use the default entrypoint script so it starts Postgres normally CMD ["docker-entrypoint.sh", "postgres", "-c", "shared_preload_libraries=pg_cron"]