Code Monkey home page Code Monkey logo

openclinica-docker's Introduction

OpenClinica on Docker (Version 3.14)

How to get OpenClinica running under docker.

1 Create the user network and a volume for the OpenClinica Database and OpenClinica Data

docker network create --driver bridge trial-net
docker volume create oc-db-data
docker volume create oc-data

2 Get Postgres running

We make it save its data in the oc-db-data volume.

Must be postgres 9.5

docker run --name=oc-db -d -v oc-db-data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=MASTER_PG_PASSWORD_CHANGE_ME --network trial-net postgres:9.5

3 Create OpenClinica Database

This makes the database for openclinica and sets a password

docker exec oc-db su postgres -c $'psql -c "CREATE ROLE clinica LOGIN ENCRYPTED PASSWORD \'OC_DB_PASSWORD_CHANGE_ME\' SUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE" && psql -c "CREATE DATABASE openclinica WITH ENCODING=\'UTF8\' OWNER=clinica" && echo "host all  clinica    0.0.0.0/0  md5" >> $PGDATA/pg_hba.conf && /usr/lib/postgresql/$PG_MAJOR/bin/pg_ctl reload -D $PGDATA'

4 Get the OpenClinica docker

git clone https://github.com/mshunshin/openclinica-docker.git

5 Fix the configuration files

The default files are located in ./openclinica.config with a .new suffix. Copy them, then edit the passwords and settings

cp ./openclinica.config/tomcat-users.xml.new ./openclinica.config/tomcat-users.xml
cp ./openclinica.config/datainfo.properties.new ./openclinica.config/datainfo.properties
cp ./openclinica.config/logging.properties.new ./openclinica.config/logging.properties

tomcat-users.xml -> change the password (all roles are removed anyway).

vi ./openclinica.config/tomcat-users.xml

<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="TOMCAT_ADMIN_PASSWORD_CHANGE_ME" roles=""/>
</tomcat-users>

datainfo.properties -> Change the database connection settings.

vi ./openclinica.config/datainfo.properties


dbType=postgres
dbUser=clinica
dbPass=OC_DB_PASSWORD_CHANGE_ME
db=openclinica
dbPort=5432
dbHost=oc-db


etc.

logging.properties -> No need to change anything here unless you want to change the log level.

vi ./openclinica.config/logging.properties

org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler

6 Build the OpenClinica Container

You must be in the openclinica directory.

cd openclinica
docker build -t oc .

7 Run the OpenClinica Container

# If running without a proxy infront opens up port 81 -> 8080
docker run --name=oc -d -v oc-data:/usr/local/tomcat/openclinica.data -p 81:8080 --network trial-net oc

# If running with a proxy you don't need to open up a port.
docker run --name=oc -d -v oc-data:/usr/local/tomcat/openclinica.data --network trial-net oc

7 Access Openclinica

Goto http://ip_address:81/OpenClinica

Tips for fixing things

I need to change the clinica user password in postgres

Get the container id for postgres

docker container ls

Then get a shell in it.

docker exec -it container_id bash

Change to the postgres user (sudo is not installed, so use su) and run psql

su postgres
psql

Then fix the password

ALTER User clinica WITH ENCRYPTED PASSWORD 'NEW_PASSWORD';
\q

openclinica-docker's People

Contributors

mshunshin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

leosfan povilasid

openclinica-docker's Issues

ERR_CONNECTION_REFUSED docker openclinica 3.14

Hi,
I try to configure docker openclinica on ubuntu engine. The ubuntu version is 20.04
root@moma:~# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c6ba71886a1f oc "/run.sh" 58 minutes ago Up 58 minutes 8080/tcp oc
e33fcdb47a37 postgres:9.5 "docker-entrypoint.sā€¦" About an hour ago Up About an hour 5432/tcp oc-db

when I try to connect to docker
http://129.114.108.170:8080/OpenClinica
I recive error of ERR_CONNECTION_REFUSED.
How I could fix it?
regards

Alberto

how can i change the path in which open clinica is deployed?

First of all, thank you for this small project that has saved me a lot of time. It is not directly a bug, but I fail to change the path in which OC is provided. How can I change the path from localhost/OpenClinica to localhost/MyNewPath?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.