Repository navigation
Replies: 3 comments 2 replies
|
What is the solution? |
|
There are two separate contexts here: For
If you only need a periodic SQL command and don't specifically need jobs inside PostgreSQL, Dokploy Schedule Jobs may be simpler: they can execute commands in a Compose service or on the server without changing the database image. I haven't reproduced your exact Dokploy image, so the exact Dockerfile depends on its image tag/distribution. Which PostgreSQL image tag are you using, and what did you enter in Advanced Settings? References: pg_cron installation and setup, Dokploy database settings, Dokploy Schedule Jobs. |
|
Hello, @Andhiksu's answer is the right way. To be clear, you can't install it manually inside the container, since it's lost on restart. You need a custom image with pg_cron. In Dokploy, set your image under Advanced → Docker Image, and add |

There are two separate contexts here:
RUN apt-get ...is a Dockerfile instruction, not SQL or a command you can enter inpsql. Installing a package manually in a running container would also be lost when that container is replaced.For
pg_cronin a Dokploy PostgreSQL 18 database:pg_cronpackage (for Debian/Ubuntu using PGDG, the package ispostgresql-18-cron), then choose it under the database's Advanced → Custom Docker Image. Keep the existing data volume and PostgreSQL major version.pg_cronto PostgreSQL'sshared_preload_libraries(pr…