Created
May 21, 2024 13:35
-
-
Save cdreier/98bc630c1398daa2a8d958c4a31be47c to your computer and use it in GitHub Desktop.
simplest single Dockerfile setup for local pg_cron
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM postgres:16-alpine | |
RUN apk update && apk add postgresql-pg_cron | |
RUN cp /usr/lib/postgresql16/pg_cron.so /usr/local/lib/postgresql/ | |
RUN cp /usr/share/postgresql/extension/* /usr/local/share/postgresql/extension | |
RUN echo "echo \"shared_preload_libraries = 'pg_cron'\" >> /var/lib/postgresql/data/postgresql.conf" >> /docker-entrypoint-initdb.d/000_bash.sh | |
RUN echo "echo \"cron.database_name = 'feeder'\" >> /var/lib/postgresql/data/postgresql.conf" >> /docker-entrypoint-initdb.d/000_bash.sh | |
RUN echo "echo \"cron.timezone = 'CEST'\" >> /var/lib/postgresql/data/postgresql.conf" >> /docker-entrypoint-initdb.d/000_bash.sh | |
RUN chmod +x /docker-entrypoint-initdb.d/000_bash.sh | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment