timescale / timescaledb-docker

Release Docker builds of TimescaleDB
Apache License 2.0
290 stars 128 forks source link

Alternative path to /docker-entrypoint-initdb.d for initialization scripts #168

Closed kornerc closed 2 years ago

kornerc commented 2 years ago

Hello,

in the docs (section Initialization scripts) of the PostgreSQL Docker image it is recommended to put initialization scripts into the folder /docker-entrypoint-initdb.d. However, the TimescaleDB Docker image uses this folder to install the TimescaleDB extension.

Is there a recommendation where to put the initialization scripts so that they cannot interfere with the TimescaleDB setup?

I ran into the problem when I was mounting ( -v <my-folder>:/docker-entrypoint-initdb.d) the folder /docker-entrypoint-initdb.d to a host folder which contains my initialization sql-scripts. Due to that the TimescaleDB setup files were removed and the extensions was not installed. The solution was to create an own image where the relevant files are copied into the folder of the image.

A colleague of mine ran into a similar issue where his scripts were executed before the TimescaleDB setup files.

Thanks, Clemens

svenklemm commented 2 years ago

If you inherit from our docker image you can use a different entrypoint