Skip to content
Snippets Groups Projects
Commit 1661593d authored by Arnaud Charleroy's avatar Arnaud Charleroy
Browse files

Update docker to version 1.0.0-rc+5.2

Add env file
parent 195b46bd
No related branches found
No related tags found
No related merge requests found
logs/nginx/log/access.log logs/nginx/log/access.log
logs/nginx/log/error.log logs/nginx/log/error.log
logs/opensilex/opensilex.log logs/opensilex/opensilex.log
logs/opensilex/** logs/opensilex/**
\ No newline at end of file docker_logs/debug.log
.gitignore
config/opensilex.yml
...@@ -3,35 +3,58 @@ ...@@ -3,35 +3,58 @@
Docker compose environnent to deploy opensilex stack based on a previous work environment variables [opensilex-phis-igepp](https://github.com/p2m2/opensilex-phis-igepp) Docker compose environnent to deploy opensilex stack based on a previous work environment variables [opensilex-phis-igepp](https://github.com/p2m2/opensilex-phis-igepp)
- [Minimalist opensilex docker compose environment](#minimalist-opensilex-docker-compose-environment) - [Minimalist opensilex docker compose environment](#minimalist-opensilex-docker-compose-environment)
- [Installation](#installation) - [Stack software name with associated versions](#stack-software-name-with-associated-versions)
- [Clone the Github repository](#clone-the-github-repository) - [Migration steps](#migration-steps)
- [Run docker stack compose command](#run-docker-stack-compose-command) - [From previous version before 1.0.0-rc+5.2](#from-previous-version-before-100-rc52)
- [Create an administrator user](#create-an-administrator-user) - [Installation steps](#installation-steps)
- [Add a reverse proxy (Optional)](#add-a-reverse-proxy-optional) - [1. Clone the Github repository](#1clone-the-github-repository)
- [2. Run docker stack compose command](#2-run-docker-stack-compose-command)
- [(First install only) Create an administrator user](#first-install-only-create-an-administrator-user)
- [(Optional) Add a reverse proxy](#optional-add-a-reverse-proxy)
- [Add a gui for mongodb (Optional)](#add-a-gui-for-mongodb-optional) - [Add a gui for mongodb (Optional)](#add-a-gui-for-mongodb-optional)
- [Test application](#test-application) - [Test application](#test-application)
- [Without reverse proxy](#without-reverse-proxy) - [Without reverse proxy](#without-reverse-proxy)
- [With reverse proxy](#with-reverse-proxy) - [With reverse proxy](#with-reverse-proxy)
- [Debug installation](#debug-installation) - [Debug installation](#debug-installation)
- [Stop docker stack](#stop-docker-stack) - [Stop docker stack](#stop-docker-stack)
- [Stop docker stack and erase all data (Be sure to delete all data )](#stop-docker-stack-and-erase-all-data-be-sure-to-delete-all-data-) - [Customize docker configuration](#customize-docker-configuration)
- [Customize docker port](#customize-docker-port)
- [Customize config file](#customize-config-file)
- [Customize hostname](#customize-hostname)
- [Manage docker](#manage-docker) - [Manage docker](#manage-docker)
- [Stop docker stack and erase all data (Be sure to delete all data)](#stop-docker-stack-and-erase-all-data-be-sure-to-delete-all-data)
- [Acknowledgments](#acknowledgments) - [Acknowledgments](#acknowledgments)
## Installation ## Stack software name with associated versions
This docker version is related to [1.0.0+rc+5.1 OpenSILEX version](https://github.com/OpenSILEX/opensilex/releases/tag/1.0.0-rc%2B5.1). - Mandatory softwares :
### Clone the Github repository - RDF4J - 3.7.4
- MongoDB - 4.2.2
- OpenSILEX - 1.0.0-rc+5.2
- Other managements softwares :
- mongo-express (A web based gui for mongo) - 1.0.0-alpha.4
- haproxy (web server used as reverse proxy) - 2.4.6
## Migration steps
### From previous version before 1.0.0-rc+5.2
If you had a previous installation run the following command to remove previous docker stack :
```bash
docker compose --env-file opensilex.env down
```
## Installation steps
This docker version is related to [1.0.0+rc+5.2 OpenSILEX version](https://github.com/OpenSILEX/opensilex/releases/tag/1.0.0-rc%2B5.2).
### 1. Clone the Github repository
```bash ```bash
git clone --branch 1.0.0-rc+5.1 https://github.com/OpenSILEX/opensilex-docker-compose git clone --branch 1.0.0-rc+5.2 https://github.com/OpenSILEX/opensilex-docker-compose
``` ```
### Run docker stack compose command ### 2. Run docker stack compose command
- Go to the following directory - Go to the following directory
...@@ -42,36 +65,42 @@ cd opensilex-docker-compose ...@@ -42,36 +65,42 @@ cd opensilex-docker-compose
- You must run docker compose up command to start your installation: - You must run docker compose up command to start your installation:
```bash ```bash
docker-compose run --rm start_opensilex_stack docker compose --env-file opensilex.env run --rm start_opensilex_stack
``` ```
- Expected Output: - Expected Output:
```bash ```bash
Creating network "opensilex-docker-compose_default" with the default driver [+] Running 3/0
Creating volume "opensilex-docker-compose_persist_rdf4j_data" with default driver ⠿ Container rdf4jdb Running 0.0s
Creating volume "opensilex-docker-compose_persist_mongo_data" with default driver ⠿ Container mongodb Running 0.0s
Creating volume "opensilex-docker-compose_persist_opensilex" with default driver ⠿ Container opensilexapp Recreated 0.0s
Creating volume "opensilex-docker-compose_haproxy_conf" with default driver [+] Running 1/1
Creating mongodb ... done ⠿ Container opensilexapp Started 0.4s
Creating rdf4jdb ... done
Creating opensilexapp ... done
Waiting for mongo to listen on 27017... Waiting for mongo to listen on 27017...
Waiting for rdf4j to listen on 8080... Waiting for rdf4j to listen on 8080...
Waiting for opensilex to listen on 8081... Waiting for opensilex to listen on 8081..
sleeping sleeping
[until it stars] sleeping
sleeping
[wait until it starts]
``` ```
### Create an administrator user After opensilex start you will be able to access to the application on port [localhost:8081](http://localhost:8081).
### (First install only) Create an administrator user
Docker volumes are persistent until you remove them. You only need to create once an user.
```bash ```bash
docker exec -it opensilexapp ./bin/opensilex.sh user add --admin --email=admin@opensilex.org --lang=fr --firstName=firstName --lastName=lastName --password=admin docker exec -it opensilexapp ./bin/opensilex.sh user add --admin --email=admin@opensilex.org --lang=fr --firstName=firstName --lastName=lastName --password=admin
``` ```
### Add a reverse proxy (Optional) ### (Optional) Add a reverse proxy
This will start the haproxy as reverse proxy for opensilex instance on port that you want to expose.
This will start the haproxy as reverse proxy for opensilex instance on port 80 It can be configure in the `./opensilex.env` with the variable `HAPROXY_EXPOSED_PORT` (Default to port 80 equivalent to [localhost](http://localhost).
```bash ```bash
docker compose --env-file opensilex.env run --rm start_opensilex_stack_proxy docker compose --env-file opensilex.env run --rm start_opensilex_stack_proxy
...@@ -79,7 +108,7 @@ docker compose --env-file opensilex.env run --rm start_opensilex_stack_proxy ...@@ -79,7 +108,7 @@ docker compose --env-file opensilex.env run --rm start_opensilex_stack_proxy
### Add a gui for mongodb (Optional) ### Add a gui for mongodb (Optional)
This will start the mongo express server that helps you do explore your mongo data on port 28018. You can also use your own robo3t or Mongo Compass App. This will start the mongo express server that helps you do explore your mongo data on port [localhost:28889](http://localhost:28889). You can also use your own robo3t or Mongo Compass App.
```bash ```bash
docker compose --env-file opensilex.env run --rm start_opensilex_stack_mongogui docker compose --env-file opensilex.env run --rm start_opensilex_stack_mongogui
...@@ -96,9 +125,9 @@ If you haven't installed [reverse proxy](#add-a-reverse-proxy-optional) ...@@ -96,9 +125,9 @@ If you haven't installed [reverse proxy](#add-a-reverse-proxy-optional)
- Web : - Web :
- Opensilex web application : <http://localhost:8081/opensilex/app> - Opensilex web application : <http://localhost:8081/opensilex/app>
- Opensilex API : <http://localhost:8081/opensilex/api-docs> - Opensilex API : <http://localhost:8081/opensilex/api-docs>
- RDF4J Workbench : <http://localhost:8080/rdf4j-workbench> - RDF4J Workbench : <http://localhost:28887/rdf4j-workbench>
- MongoDB port : <http://localhost:27017> - MongoDB port : <http://localhost:28888>
- MongoDB express : <http://localhost:28018> - MongoDB express : <http://localhost:28889>
#### With reverse proxy #### With reverse proxy
...@@ -108,15 +137,15 @@ If you have installed [reverse proxy](#add-a-reverse-proxy-optional) ...@@ -108,15 +137,15 @@ If you have installed [reverse proxy](#add-a-reverse-proxy-optional)
- Opensilex web application : <http://localhost/opensilex/app> - Opensilex web application : <http://localhost/opensilex/app>
- Opensilex API : <http://localhost/opensilex/api-docs> - Opensilex API : <http://localhost/opensilex/api-docs>
- RDF4J Workbench : <http://localhost/rdf4j-workbench> - RDF4J Workbench : <http://localhost/rdf4j-workbench>
- MongoDB port : <http://localhost:27017> - MongoDB port : <http://localhost:28888>
- MongoDB express : <http://localhost:28018> - MongoDB express : <http://localhost/mongoadmin>
### Debug installation ### Debug installation
This command will give you stack trace of the docker build. This command will give you stack trace of the docker build.
```bash ```bash
docker compose --env-file opensilex.env up --build --force-recreate > debug.log docker compose --env-file opensilex.env build > docker_logs/debug.log
``` ```
### Stop docker stack ### Stop docker stack
...@@ -127,32 +156,47 @@ This command will stop the stack. ...@@ -127,32 +156,47 @@ This command will stop the stack.
docker compose --env-file opensilex.env down docker compose --env-file opensilex.env down
``` ```
### Stop docker stack and erase all data (Be sure to delete all data ) ## Customize docker configuration
This command will give you stack trace of the docker build. Configure `opensilex.env` file to configure opensilex sparql config, applications ports, applciations volumes
```bash ```bash
docker compose --env-file opensilex.env down --volumes # CAN BE MODIFIED
```
# SPARQL
BASEURI=http://www.opensilex.org/
BASEURIALIAS=opensilex
REPOSITORIES_NAME=opensilex-docker-db
OPENSILEX_PATH_PREFIX=opensilex
# PORTS
HAPROXY_EXPOSED_PORT=80
OPENSILEX_EXPOSED_PORT=8081
RDF4J_EXPOSED_PORT=28887
MONGO_EXPOSED_PORT=28888
MONGO_EXPRESS_EXPOSED_PORT=28889
# VOLUMES # can be a folder on host or a docker volume
RDF4J_VOLUME="/home/charlero/test_docker"
MONGO_VOLUME="persist_mongo_data"
MONGO_VOLUME="persist_opensilex"
### Customize docker port ```
Configure `docker-compose.yml` file to configure opensilex stack ports
_TODO : Add exemples_ _TODO : Add exemples_
### Customize config file ## Manage docker
Configure config/opensilex.yml file to configure opensilex stack
_TODO : Add exemples_
### Customize hostname In order to manage your docker stack via an web interface, we suggest you to use [Portainer CE edition](https://docs.portainer.io/start/install/server/docker/linux#deployment)
## Danger Zone
Update host parameters if needeed on docker-compose.yml and opensilex.env files. ### Stop docker stack and erase all data (Be sure to delete all data)
_TODO_
## Manage docker This command will give you stack trace of the docker build.
In order to manage your docker stack via an web interface, we suggest you to use [Portainer CE edition](https://docs.portainer.io/start/install?_ga=2.152302650.2059608137.1662022383-1714209046.1662022383) ```bash
docker compose --env-file opensilex.env down --volumes
```
## Acknowledgments ## Acknowledgments
......
ontologies: ontologies:
baseURI: http://www.opensilex.org/ baseURI: $BASEURI
baseURIAlias: opensilex baseURIAlias: $BASEURIALIAS
sparql: sparql:
config: config:
serverURI: http://rdf4j:8080/rdf4j-server/ serverURI: http://rdf4j:8080/rdf4j-server/
repository: opensilex repository: $REPOSITORIES_NAME
# Configuration for module: FileStorageModule (FileStorageConfig) # Configuration for module: FileStorageModule (FileStorageConfig)
file-system: file-system:
...@@ -23,7 +23,7 @@ file-system: ...@@ -23,7 +23,7 @@ file-system:
host: mongodb host: mongodb
# MongoDB main host port (int) # MongoDB main host port (int)
port: 27017 port: 27017
database: opensilex database: $REPOSITORIES_NAME
local: local:
# Service implementation class for: local (FileStorageConnection) # Service implementation class for: local (FileStorageConnection)
implementation: org.opensilex.fs.local.LocalFileSystemConnection implementation: org.opensilex.fs.local.LocalFileSystemConnection
...@@ -36,7 +36,7 @@ big-data: ...@@ -36,7 +36,7 @@ big-data:
config: config:
host: mongodb host: mongodb
port: 27017 port: 27017
database: opensilex database: $REPOSITORIES_NAME
server: server:
pathPrefix: /opensilex pathPrefix: /$OPENSILEX_PATH_PREFIX
publicURI: http://localhost:$HAPROXY_PORT publicURI: "http://localhost:$HAPROXY_EXPOSED_PORT"
...@@ -5,8 +5,6 @@ services: ...@@ -5,8 +5,6 @@ services:
container_name: haproxy container_name: haproxy
restart: always restart: always
env_file: opensilex.env env_file: opensilex.env
environment:
- HAPROXY_PORT=${HAPROXY_PORT}
build: build:
context: . context: .
dockerfile: haproxy-build-step.docker dockerfile: haproxy-build-step.docker
...@@ -16,13 +14,13 @@ services: ...@@ -16,13 +14,13 @@ services:
volumes: volumes:
- haproxy_conf:/usr/local/etc/haproxy - haproxy_conf:/usr/local/etc/haproxy
ports: ports:
- "$HAPROXY_PORT:80" - "$HAPROXY_EXPOSED_PORT:80"
mongo: mongo:
container_name: mongodb container_name: mongodb
image: mongo:5.0.2 image: mongo:4.2.2
restart: always restart: always
volumes: volumes:
- persist_mongo_data:/data - $MONGO_VOLUME:/data
command: > command: >
bash -c " bash -c "
( (
...@@ -32,50 +30,55 @@ services: ...@@ -32,50 +30,55 @@ services:
) & docker-entrypoint.sh --replSet opensilex ) & docker-entrypoint.sh --replSet opensilex
" "
ports: ports:
- 28887:27017 - "$MONGO_EXPOSED_PORT:27017"
rdf4j:
container_name: rdf4jdb
image: eclipse/rdf4j-workbench:3.7.4
env_file: opensilex.env
volumes:
- $RDF4J_VOLUME:/var/rdf4j
ports:
- "$RDF4J_EXPOSED_PORT:8080"
mongoexpress: mongoexpress:
image: mongo-express image: mongo-express
container_name: mongoexpressgui container_name: mongoexpressgui
restart: always restart: always
ports: ports:
- "28889:8081" - "$MONGO_EXPRESS_EXPOSED_PORT:8081"
environment: environment:
ME_CONFIG_MONGODB_SERVER: mongodb ME_CONFIG_MONGODB_SERVER: mongodb
ME_CONFIG_MONGODB_URL: mongo://mongodb:27017/ ME_CONFIG_MONGODB_URL: mongo://mongodb:27017/
depends_on: depends_on:
- mongo - mongo
rdf4j:
container_name: rdf4jdb
image: eclipse/rdf4j-workbench:3.7.6
env_file: opensilex.env
volumes:
- persist_rdf4j_data:/var/rdf4j
ports:
- "28888:8080"
opensilex: opensilex:
container_name: opensilexapp container_name: opensilexapp
build: build:
context: . context: .
args: args:
RELEASE_TAG: 1.0.0-rc+5.2 RELEASE_TAG: 1.0.0-rc+5.2 # can be modify to change version
dockerfile: opensilex-build-step.docker dockerfile: opensilex-build-step.docker
env_file: opensilex.env env_file: opensilex.env
depends_on: depends_on:
- mongo - mongo
- rdf4j - rdf4j
volumes: volumes:
- ./config:/home/opensilex/config - $OPENSILEX_CONFIG_VOLUME:/home/opensilex/config
- ./logs/opensilex:/home/opensilex/logs - $OPENSILEX_LOGS_VOLUME:/home/opensilex/logs
- persist_opensilex:/home/opensilex/data - $OPENSILEX_DATA_VOLUME:/home/opensilex/data
command: > command: >
bash -c " bash -c "
printenv &&
envsubst < /home/opensilex/config/opensilex-template.yml | more &&
echo 'test' &&
envsubst < /home/opensilex/config/opensilex-template.yml > /home/opensilex/config/opensilex.yml &&
([ ! -f /home/opensilex/data/first_install ] && touch /home/opensilex/data/first_install && ./bin/opensilex.sh system install --DEBUG) ([ ! -f /home/opensilex/data/first_install ] && touch /home/opensilex/data/first_install && ./bin/opensilex.sh system install --DEBUG)
./bin/opensilex.sh server start --host=localhost --port=$OPENSILEX_PORT --adminPort=4081 ./bin/opensilex.sh server start --host=localhost --port=8081 --adminPort=4081
" "
ports: ports:
- "$OPENSILEX_PORT:8081" - "$OPENSILEX_EXPOSED_PORT:8081"
start_opensilex_stack: start_opensilex_stack:
image: dadarek/wait-for-dependencies image: dadarek/wait-for-dependencies
depends_on: depends_on:
......
FROM haproxy:2.6.4 FROM haproxy:2.6.6
USER root USER root
RUN mkdir /run/haproxy && chown haproxy:haproxy /run/haproxy && chmod 2775 /run/haproxy RUN mkdir /run/haproxy && chown haproxy:haproxy /run/haproxy && chmod 2775 /run/haproxy
USER haproxy USER haproxy
......
...@@ -48,7 +48,8 @@ frontend http-web ...@@ -48,7 +48,8 @@ frontend http-web
mode http mode http
acl is_opensilexserver path_beg /"$OPENSILEX_PATH_PREFIX" acl is_opensilexserver path_beg /"$OPENSILEX_PATH_PREFIX"
acl is_rdf4jserver path_beg /"$RDFSTORE_HOST" acl is_rdf4jserver path_beg /"$RDFSTORE_HOST"
acl is_mongoadmin path_beg /"$MONGO_EXPRESS_HOST"
acl is_css path_end css acl is_css path_end css
acl is_js path_end js acl is_js path_end js
...@@ -57,9 +58,9 @@ frontend http-web ...@@ -57,9 +58,9 @@ frontend http-web
use_backend opensilexserver if is_opensilexserver use_backend opensilexserver if is_opensilexserver
use_backend rdf4jserver if is_rdf4jserver use_backend rdf4jserver if is_rdf4jserver
use_backend mongoadminserver if is_mongoadmin
backend opensilexserver backend opensilexserver
#timeout client 300s
timeout server 300s timeout server 300s
mode http mode http
acl is_css path_end css acl is_css path_end css
...@@ -68,7 +69,9 @@ backend opensilexserver ...@@ -68,7 +69,9 @@ backend opensilexserver
http-request set-header Content-Type application/javascript if is_js http-request set-header Content-Type application/javascript if is_js
server app opensilex:8081/"$OPENSILEX_PATH_PREFIX" check server app opensilex:8081/"$OPENSILEX_PATH_PREFIX" check
backend rdf4jserver backend rdf4jserver
server graph rdf4j:8080 check server graph rdf4j:8080 check
backend mongoadminserver
server mongoadmin mongoexpress:8081 check
FROM tomcat:jre11-openjdk-slim FROM tomcat:jre11-openjdk-slim
ARG RELEASE_TAG=1.0.0-rc+5.1 ARG RELEASE_TAG=1.0.0-rc+5.2
ENV RELEASE https://github.com/OpenSILEX/opensilex/releases/download/$RELEASE_TAG/opensilex-release-$RELEASE_TAG.zip ENV RELEASE https://github.com/OpenSILEX/opensilex/releases/download/$RELEASE_TAG/opensilex-release-$RELEASE_TAG.zip
RUN apt-get -y update && apt-get install -y wget zip RUN apt-get -y update && apt-get install -y wget zip gettext-base
RUN mkdir -p /home/opensilex RUN mkdir -p /home/opensilex
WORKDIR /home/opensilex/bin WORKDIR /home/opensilex/bin
...@@ -12,6 +12,5 @@ RUN unzip $( basename ${RELEASE} ) ...@@ -12,6 +12,5 @@ RUN unzip $( basename ${RELEASE} )
RUN ls RUN ls
COPY ./bin/opensilex.sh /home/opensilex/bin/ COPY ./bin/opensilex.sh /home/opensilex/bin/
COPY ./bin/logback.xml /home/opensilex/bin/ COPY ./bin/logback.xml /home/opensilex/bin/
COPY ./config/opensilex.yml /home/opensilex/config/ COPY ./config/opensilex-template.yml /home/opensilex/config/
WORKDIR /home/opensilex WORKDIR /home/opensilex
\ No newline at end of file
# MUST NOT BE MODIFIED
COMPOSE_PROJECT_NAME=opensilex-stack COMPOSE_PROJECT_NAME=opensilex-stack
RDF4J_JAVA_OPTS="-Xms1g -Xmx4g" RDF4J_JAVA_OPTS="-Xms1g -Xmx4g"
RDFSTORE_SPARQL=http://rdf4j:8080/rdf4j-workbench/repositories/opensilex/query RDFSTORE_SPARQL=http://rdf4j:8080/rdf4j-workbench/repositories/opensilex/query
...@@ -7,10 +9,27 @@ MONGO_HOST=mongo ...@@ -7,10 +9,27 @@ MONGO_HOST=mongo
OPENSILEX_HOST=opensilex OPENSILEX_HOST=opensilex
OPENSILEX_PATH_PREFIX=opensilex OPENSILEX_PATH_PREFIX=opensilex
MONGO_EXPRESS_HOST=mongoexpress MONGO_EXPRESS_HOST=mongoadmin
OPENSILEX_PORT=8081 OPENSILEX_CONFIG_VOLUME=./config
HAPROXY_PORT=80 # CAN BE MODIFIED
# SPARQL
BASEURI=http://www.opensilex.org/
BASEURIALIAS=opensilex
REPOSITORIES_NAME=opensilex-docker-db
# customize path prefix Ex : localhost:8081/opensilex or localhost:8081/phenotyping_si
OPENSILEX_PATH_PREFIX="opensilex"
# PORTS
HAPROXY_EXPOSED_PORT=80
OPENSILEX_EXPOSED_PORT=8081
RDF4J_EXPOSED_PORT=28887
MONGO_EXPOSED_PORT=28888
MONGO_EXPRESS_EXPOSED_PORT=28889
# VOLUMES # can be a folder on host or a docker volume by default
RDF4J_VOLUME="/home/charlero/test_docker"
MONGO_VOLUME="persist_mongo_data"
OPENSILEX_DATA_VOLUME=persist_opensilex
OPENSILEX_LOGS_VOLUME=./logs/opensilex
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment