Fork me on GitHub

That eliminates the error, but now I get:

java.util.concurrent.ExecutionException: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "", user "datomic", database "datomic", SSL off


I tried copying a custom pg_hba.conf using COPY:

1 host    all             all               trust
  2 host    all             all              trust


but on initdb in the postgres dockerfile:

initdb: error: directory "/var/lib/postgresql/data" exists but is not empty


How to fix this, and what determines the ip?


@ps this is the ip assigned via the docker bridge network. when you use the container name as the host name, the docker network acts as the DNS by adding the entries to /etc/resolv.conf. hence we are able to look up by container name. I would highly recomend reading up on on docker networking as i think this would be helpful for a larger scale setup youre planning: and , applies to k8s and others too. this is quite a fundamental aspect of docker thats very important to know. For the postgres error i think something else has run and created the db and youre trying to run the init db again. if all of the docker code is available in somewhere, we could help better 🙂


actually I think that the reason it’s erroring out is because initdb writes files to /var/lib/postgresql/data including generated pg_hba but since I already copy a custom pg_hba to that directory it gives the error


Here are the docker files, the create_db script, the deps.edn the custom pg_hba and the sql-transactor-template (you must add your license key)


this one has the copy command in the correct position. Ignore the previous zip


running the transactor now gives:

java.util.concurrent.ExecutionException: org.postgresql.util.PSQLException: FATAL: role "datomic" does not exist


try starting the postgres container with the POSTGRES_PASSWORD, POSTGRES_USER, POSTGRES_DB set to the values you want. the env vars described in that should create the user and you should not need the custom hba conf to connect too as long as youre using these credentials and user


I think the easiest thing to do now is to figure out a way to create the datomic role


thats what the user is


set POSTGRES_USER to datomic


if you start the container with these env vars, its created for you


something like

docker run \
	-e POSTGRES_USER=datomic \
	-e POSTGRES_DB=datomic \


it still gives role datomic doesn’t exit


this should work. make sure youre connecting to the right container. the command above will create a new container. id suggest kill all postgres containers and use the env vars in the container you were creating before with the name


I simply used the default postgres role in the transactor


ad now it gives database “datomic” does not exist


In Dockerfile_postgres lines:

12 RUN cp bin/sql/postgres-db.sql /docker-entrypoint-initdb.d
 13 RUN cp bin/sql/postgres-table.sql /docker-entrypoint-initdb.d
 14 RUN cp bin/sql/postgres-user.sql /docker-entrypoint-initdb.d
 15 USER postgres
 16 RUN initdb
are for this purpose but it doesn’t seem to create the database datomic


im not very familiar with datomic, maybe you could try examples like ? also you could try asking in #datomic for some recommended docker setup


The reason this isn’t working is because the scripts that I copy to docker-entrypoint-initdb.d aren’t running


and the postgres-db.sql script creates that db