OLDP has a containerized version based on Docker. If you just want to try out the platform locally, this is the recommended way to do it. The Docker image is available at Docker Hub.

Getting started

The OLDP web app depends services like search, db, cache. To run all service in orchestrated fashion use docker-compose as following:

# Build & start services
docker-compose up

To stop the services run docker-compose down or press CRTL+C.

In beginning the database will be empty, thus, we need to create all tables in the newly created database.

docker exec -it oldp_app_1 python migrate

You have probably noticed that you set the login credentials for the MySQL database in docker-compose.yml. By default, Django is using the same settings. But if you change those, you need to adjust the DATABASE_URL variable.

export DATABASE_URL="mysql://oldp:oldp@"

Import some demo data (from fixtures - see more in testing docs)

docker exec -it oldp_app_1 python loaddata \
    locations/countries.json \
    locations/states.json \
    locations/cities.json \
    courts/courts.json \
    laws/laws.json \

Compile localization files

docker exec -it oldp_app_1 python compilemessages --l de --l en

Create superuser (admin, pw: admin)

docker exec -it oldp_app_1 python shell -c \
    "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '', 'admin')"

Common issues

Old image version

If you encounter any problems, please pull the latest image first.

docker pull openlegaldata/oldp:latest

Invalid file system permissions

Sometimes Elasticsearch has problems writing to its data directory. To solve this, set access rights:

# Quick & Dirty
chmod 777 docker/data/es

# Correct user group
chown docker:docker docker/data/es

Additional notes

# Build image from repo
docker build -t oldp .

# Tag image as latest
# - locally
docker tag oldp:latest  

# - hub
docker tag oldp openlegaldata/oldp:latest  

# Push to hub
docker push openlegaldata/oldp:latest

# Start a container
docker run oldp

# Override environment variables
docker run -e DATABASE_URL="sqlite:///db/db.sqlite" -it oldp python runserver