eXist - Kick-start Development with Docker

This post shows How-to setup a development environment for an eXist database.

eXistdb - Vitamins for your Applications

Docker all the things!

A minimal non-invasive setup with Docker Compose. We choose the official image created from evolvedbinary/docker-existdb.

Create a docker-compose.yaml for your “all-in-one solution for application building”:

version: "3.5"
services:
  exist: 
    image: evolvedbinary/exist-db:eXist-4.0.0
    ports:
      - "127.0.0.1:8080:8080"

You are ready to test-drive the database without installing any files into your regular development environment.

Note: If your local port 8080 is already in use please change the part 127.0.0.1:8080 as follows 127.0.0.1:<free port>.

$ docker-compose up

Browse to http://localhost:8080/ or whatever port you have chosen.

Note: Default username and password is admin with an empty password.

At this point you should see the eXist dashboard similar to the screenshot below:

eXist Dashboard

Since all data is stored inside the container, every time you recreate your eXist database you'll lose all your data and configuration.

If you want to persist your data through eXist restarts you can use volumes configurations. The following, updated docker-compose.yaml, stores the eXist data on the host:

version: "3.5"
services:
  exist: 
    image: evolvedbinary/exist-db:eXist-4.3.0
    ports:
      - "127.0.0.1:8080:8080"
    volumes:
      - type: bind
        source: ./exist-data
        target: /exist-data

Let’s Getting Started with Web Application Development...

PS: Once you finished the "Getting Started" you might be interested in From eXist Tutorial Application to Continuous Delivery

Just in case: There is a valuable Troubleshooting guide available.

For those (hopefully) rare cases where you need to attach a Java Debugger you can override the entrypoint in the docker-compose.yaml:

    entrypoint:
      - /usr/lib/jvm/java-8-openjdk-amd64/bin/java
      - -Dexist.home=/exist
      - -Djava.awt.headless=true
      - -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
      - -jar
      - /exist/start.jar
      - jetty

If you are serious about working with eXist you may want to add the book “eXist” to your (physical) library.