Run Docker postgres image with custom postgresql.conf

I’m using a postgres container to test my Rails app. But some queries are struggling and checking the RAM usage, the configuration could be optimized to use more RAM resources and more CPUs.

Checking the Docker postgres image docs you can setup a new postgresql.conf file and call it in the docker run. How could I do that in the CircleCI YAML config?

Just a guess, and might be another way to do this within CircleCI (I haven’t personally messed much with volume mounts / files on accessory containers), but maybe it would work to use POSTGRES_INITDB_ARGS, which might be easier than figuring out how to drop in a conf file?

Quickly looking through Circle’s docs on db configuration, I didn’t see another obvious way, though it may be doable some other way

1 Like