Getting Started
In the following we will show you how to host your own instance of the ELNdataBridge and set it up for a simple synchronization.
How to host it
Hosting an instance of ELNdataBridge is easy thanks to the provided Docker image. Below we present a Docker Compose file that should enable installation in a few steps.
1services:
2 db:
3 image: postgres:17
4 restart: unless-stopped
5 hostname: db
6 expose:
7 - 5432
8 ports:
9 - ${DJANGO_POSTGRES_PORT:-65432}:5432
10 environment:
11 - POSTGRES_USER=${DJANGO_POSTGRES_USER}
12 - POSTGRES_PASSWORD=${DJANGO_POSTGRES_PASSWORD}
13 - POSTGRES_DB=${DJANGO_POSTGRES_NAME}
14 env_file:
15 - ./.env
16 volumes:
17 - bridge_db:/var/lib/postgresql/data/
18 web:
19 image: mstarman/elndatabridge:0.3.25
20 depends_on:
21 - db
22 env_file:
23 - ./.env
24 ports:
25 - ${DJANGO_PORT:-3211}:80
26volumes:
27 bridge_db:
And the necessary .env file:
1 MODE=prod
2 ALLOWED_HOST=http://URL_TO_ELNdataBridge # HOST url the ELNdataBridge from outside the local host
3 DJANGO_SUPERUSER_USERNAME=sample # Creates an admin user
4 DJANGO_SUPERUSER_EMAIL=mr.sample@kit.edu # E-mail for the admin user
5 DJANGO_SUPERUSER_PASSWORD=1234qweR! # Password for the admin user
6 DJANGO_POSTGRES_NAME=bridge
7 DJANGO_POSTGRES_USER=postgres
8 DJANGO_POSTGRES_PASSWORD=afj134uddfGGfQA*WS24D! # IMPORTANT! generate new Password
9 DJANGO_PORT=3211 # Port the ELNdataBridge can be reached
In order to host an instance, it is necessary to adjust only the variables contained within the .env file. Furthermore, it is essential to copy the two files, docker-compose.yml and .env, to the same folder of the host system. The instance can then be started using the command docker compose up. However, it is advisable to employ general measures in order to ensure the security of the hosting. For example, an HTTP web server such as nginx should be used.