Public | Automated Build

Last pushed: 6 months ago
Short Description
Run CollectionSpace in Docker
Full Description

Docker CollectionSpace


Run CollectionSpace in Docker.

Quickstart

# postgres
docker run --name postgres -d \
  --net=host \
  -e POSTGRES_PASSWORD=654321 \
  -e DB_CSADMIN_PASSWORD=123456 \
  lyrasis/collectionspace:db

# PT.1: create temporary `create_db` container to setup database
docker run --name cspace -it --rm \
  --net=host \
  lyrasis/collectionspace /create_db.sh

# PT.2: run again for collectionspace (omitting `/create_db.sh` and run in background)
docker run --name cspace -d \
  --net=host \
  lyrasis/collectionspace

docker logs -f cspace # view log output

Access CollectionSpace at: http://localhost:8180/collectionspace/ui/core/html/index.html.

To preserve tenant data use a volume mount like:

-v $(pwd)/data:/apache-tomcat-7.0.57/nuxeo-server/data/default \

Local builds

git clone https://github.com/lyrasis/docker-collectionspace
cd docker-collectionspace

# example build commands
docker build -t collectionspace/db db/
docker build -t collectionspace/base base/
docker build --no-cache=true -t collectionspace/latest latest/

# run postgres (see quickstart)
docker run --name postgres -d \
  --net=host \
  -e POSTGRES_PASSWORD=654321 \
  -e DB_CSADMIN_PASSWORD=123456 \
  collectionspace/db

docker logs -f db

# create database
docker run --name cspace -it --rm \
  --net=host \
  collectionspace/latest /create_db.sh

# run cspace
docker run --name cspace -d \
  --net=host \
  collectionspace/latest

docker logs -f cspace

Custom builds

See latest/Dockerfile for the build-arg options. Here's a docker-compose example:

version: '2'
services:
  app:
    container_name: core
    build:
      context: latest
      args:
        COLLECTIONSPACE_BRANCH: master
        COLLECTIONSPACE_REPOSITORY: https://github.com/collectionspace
        COLLECTIONSPACE_TENANT: core
        COLLECTIONSPACE_TOMCAT: apache-tomcat-7.0.57
        COLLECTIONSPACE_TOMCAT_PORT_PREFIX: 81
        COLLECTIONSPACE_VERSION: 4.4
        CSPACE_TENANT_CREATE_DISABLED_OPT: "true"
        DB_HOST: 127.0.0.1
        DB_CSADMIN_PASSWORD: 123456
        DB_CSPACE_PASSWORD: 123456
        DB_NUXEO_PASSWORD: 123456
        DB_READER_PASSWORD: 123456
    network_mode: "host"
    logging:
      driver: "syslog"
    environment:
      CATALINA_OPTS: "-Xmx1024m -XX:MaxPermSize=384m"
      CSPACE_CORE_CREATE_DISABLED_OPT: "false"
    volumes: []

Development

This is primararily intended for developers looking to implement a tenant configuration.

# run postgres (see quickstart)

# build
docker build -t collectionspace/dev dev/

# run cspace dev (from path containing source layers)
docker run --name cspace-dev -d \
  --net=host \
  -v /$(pwd)/src/application:/application \
  -v /$(pwd)/src/services:/services \
  -v /$(pwd)/src/ui:/ui \
  collectionspace/dev

docker logs -f cspace-dev

# run build commands as needed
docker exec -it cspace-dev /mvn.sh services
docker exec -it cspace-dev /mvn.sh application
docker exec -it cspace-dev /mvn.sh ui
docker exec -it cspace-dev /ant.sh
docker exec -it cspace-dev /create_db.sh
docker exec -it cspace-dev /start.sh
docker exec -it cspace-dev /bin/bash

Note, the ENV can easily be overriden as needed:

# run cspace dev (from path containing source layers)
docker run --name cspace-dev -d \
  --net=host \
  -v /$(pwd)/application:/application \
  -v /$(pwd)/services:/services \
  -v /$(pwd)/ui:/ui \
  -e "CSPACE_INSTANCE_ID=_mymuseum" \
  -e "CSPACE_MYMUSEUM_CREATE_DISABLED_OPT=false" \
  collectionspace:dev

License

This project is available as open source under the terms of the MIT License.


Docker Pull Command
Owner
lyrasis
Source Repository

Comments (0)