Fork me on GitHub

I’m trying to run Datomic and my clojure server as two services using docker compose locally, and this is my compose file:

version: '3'
    image: akiel/datomic-free
        - ADMIN_PASSWORD="admin"
        - DATOMIC_PASSWORD="datomic"
    build: .
      - "3001:3000"
This was working without docker where I was running the transactor on the machine directly using the local dev instructions on the datomic website, but using docker compose, I get the following error when making a request to my server that involves a database transaction: Relevant code:
(def db-uri "datomic:")

(def *conn
  "Get shared connection."
  (delay (d/connect db-uri)))

(defn install-schema
  "This function expected to be called at system start up.

  Datomic schema migrations or db preinstalled data can be put into 'migrations/schema.edn'
  Every txes will be executed exactly once no matter how many times system restart."
  (prn "installing schema")
  (let [schema-map (read-string (slurp "resources/migrations/schema.edn"))]
    (prn "schema map" schema-map)
    @(d/transact (force *conn) (:creator-schema schema-map))
    @(d/transact (force *conn) (:creation-schema schema-map))

(defn init-db [_]
  (prn "database created " (d/create-database db-uri))
  (try (install-schema)
       (catch Exception e (prn "installing schema" e)))
  (r/response "ok")
The http request calls init-db

Drew Verlee18:07:30

the error is saying the jdbc client cant reach mysql. So somehow that address is wrong.

Drew Verlee18:07:55

maybe its supposed to be datomic:4335?

Drew Verlee18:07:38


(def db-uri "datomic:")


that gives: Caused by: org.h2.jdbc.JdbcSQLException: Wrong user name or password [28000-171]

Drew Verlee19:07:26

well it connected, so the next step is to give it the right username and password.


do you see anywhere here to give a username or password?

Drew Verlee21:07:43

it's currently passed in the db-url or at least the password is

Drew Verlee21:07:09

what your passing looks correct in that it matches the grammar of the string on the githubpage

Drew Verlee21:07:40

security is a PITA because it's not specific about whats wrong. e.g password or user (of course it can't know, but it also doesnt want to share)

Drew Verlee21:07:27

(def db-uri "datomic:")


If I'm using dynamodb in prod, can i also use dynamodb locally? Should I be? Is it seamless to restore a dynamo db into local if the storage engines are different ?


Ah i see the dynamodb local storage. I didn't know that was an option. Is that recommended ?


Using Datomic on-prem to move across storages is a great feature of backup and restore. However for we recommend running with all system processes down, run the restore, then start the transactor and peers.