{"id":22663601,"url":"https://github.com/galuque/datomic-compose","last_synced_at":"2025-07-14T16:39:57.014Z","repository":{"id":178477676,"uuid":"638683932","full_name":"galuque/datomic-compose","owner":"galuque","description":"Docker Compose for running a Datomic system","archived":false,"fork":false,"pushed_at":"2023-07-03T23:32:45.000Z","size":503,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T23:38:18.050Z","etag":null,"topics":["clojure","database","datomic","docker"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galuque.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-09T22:04:55.000Z","updated_at":"2025-06-19T06:57:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"b91e42bb-91f8-47de-b643-014cb535da29","html_url":"https://github.com/galuque/datomic-compose","commit_stats":null,"previous_names":["galuque/datomic-compose"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/galuque/datomic-compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galuque%2Fdatomic-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galuque%2Fdatomic-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galuque%2Fdatomic-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galuque%2Fdatomic-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galuque","download_url":"https://codeload.github.com/galuque/datomic-compose/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galuque%2Fdatomic-compose/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265319586,"owners_count":23746364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","database","datomic","docker"],"created_at":"2024-12-09T12:31:08.764Z","updated_at":"2025-07-14T16:39:56.995Z","avatar_url":"https://github.com/galuque.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Datomic Docker Compose\n\nThe Datomic team recently [changed the license of the database](https://blog.datomic.com/2023/04/datomic-is-free.html) to Apache 2.0\n\nThis let's devolopers use the pro version of Datomic without a license fee and without registration.\n\nThis repo provides a docker compose file that set ups a Datomic system with the pro version, so you can use it for development or testing out the database.\n\nI started it as a way of learning how to use Datomic, and then I keep wonderinng \"what should I add next to make it more like a production system?\". And here we are.\n\nI'm sharing it in case it's useful for someone else who's looking to learn Datomic or want's to try self hosting it. If you have any suggestions or improvements, please let me know.\n\nThe system uses a SQL storage service, backed by a Postgres database, and a memcached service for caching.\n\nThe datomic architecture is described [here](https://docs.datomic.com/pro/overview/architecture.html)\n\nA great video explaining the architecture is [Deconstructing the Database](https://www.infoq.com/presentations/Deconstructing-Database/)\n\nBesides the storage and cache services the compose file sets up a datomic transactor, a peer server, and a [console](https://docs.datomic.com/pro/other-tools/console.html)\n\n## Requirements\n\n- [Docker](https://docs.docker.com/engine/install/)\n- [Clojure](https://clojure.org/guides/install_clojure) (for running the apps)\n\n## Running it\n\nTo start it:\n\n```shell\ndocker compose up -d\n```\n\nWhen the setup is finish you should see five containers running with the following names:\n\n```shell\n;; docker ps --filter=\"name=datomic-compose\" --format \"table {{ .Image }}\\t{{ .Names }}\"\nIMAGE                     NAMES\ndatomic:1.0.6735-java17   datomic-compose-console-1\ndatomic:1.0.6735-java17   datomic-compose-peer-server-1\ndatomic:1.0.6735-java17   datomic-compose-transactor-1\nmemcached:1.6-bullseye    datomic-compose-memcached-1\npostgres:15-bullseye      datomic-compose-postgres-1\n```\n\n## Stopping it\n\nTo stop it:\n\n```shell\ndocker compose down\n```\n\nIf you want to remove the volumes:\n\n```shell\ndocker compose down -v\n```\n\n## What does the compose file do?\n\n- Set up a Postgres database on port `5432` with:\n    - User and password: datomic/datomic\n    - A `datomic` database with a `datomic_kvs` table\n\n- Set up a memcached server on port `11211`\n\n- Set up a transactor configured to connect to the postgres server and memcached service. You accomplish this setting the `sql-url`, `sql-user`and `sql-password` keys in the `files/sql-transactor.properties` file: \n\n```ini\nsql-url=jdbc:postgresql://postgres:5432/datomic\nsql-user=datomic\nsql-password=datomic\n\nmemcached=memcached:11211\n```\n\n(The names `postgres` and `memcached` are the names of the services in the docker compose file)\n\n- Execute a init script that creates a database _in datomic_ named `datomic` (this is different from the postgres one)\n\n- Run a peer server on port `8998` that connects to the postgres database and memcached service and serves the datomic `datomic` database\n\n```shell\n/opt/datomic/bin/run -m datomic.peer-server -h 0.0.0.0 -p 8998 -Ddatomic.memcachedServers=memcached:11211 -a accesskey,secret -d 'datomic,datomic:sql://datomic?jdbc:postgresql://postgres:5432/datomic?user=datomic\u0026password=datomic'\n```\n\n(The command is in the `files/peer-server.sh` file for convenience)\n(Note the we set an access key and secret, this is required to connect to the peer server from the client)\n\n- Run a console on port `8080` that connects to the peer server\n\n```shell\n/opt/datomic/bin/run -m datomic.console -p 8080 dev datomic:dev://localhost:8998/\n```\n\n### Monitoring\n\nIn the `monitoring` branch of this repo there is a compose file that sets up a [Prometheus](https://prometheus.io/) server and a [Grafana](https://grafana.com/) server, it's not finished yet, but you can create your own dashboards.\n\n## Sample apps\n\nThere are two folders with minimal clojure projects, `peer` and `client`.\n\nIn the `peer` folder there is a minimal `deps.edn` project to connect to the running transactor. This is a Peer App Process: Application code that uses the datomic peer library embdedded in the same process.\n\nIn the `client` folder there is another minimal `deps.edn` project to connect to the running peer server. It only uses the datomic client library.\n\n### Running the peer app\n\nTo run the peer app:\n\n```shell\ncd app/peer\nclojure -M:repl\n```\n\nThis will start a repl with the peer app running. You can connnect to that repl from your editor and evaluate the code in the `app/peer/src/datomic_compose/peer.clj` file.\n\n### Running the client app\n\nTo run the client app:\n\n```shell\ncd app/client\nclojure -M:repl\n```\n\nAgain, this will start a repl with the client app running. You can connnect to that repl from your editor and evaluate the code in the `app/client/src/datomic_compose/client.clj` file.\n\nIf you executed the code of peer app before, you should see the same data in the client app.\n\n## Changing the transactor configuration\n\nIf you want to change the transactor configuration, you can do it in the `files/sql-transactor.properties` file.\n\nThe `docker-compose.yml` is configured has the `configs` properties to use that file in the transactor service, like this:\n\n```yaml\n    transactor:\n    ...\n    configs:\n        - transactor.properties\n    ...\n\nconfigs:\n    transactor.properties:\n        file: ./files/sql-transactor.properties\n```\n\nSee the docker documentation on [top level configs](https://docs.docker.com/compose/compose-file/08-configs/) and [service configs](https://docs.docker.com/compose/compose-file/05-services/#configs) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaluque%2Fdatomic-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaluque%2Fdatomic-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaluque%2Fdatomic-compose/lists"}