Install with Docker

This page explain how to start Datashare within a Docker.


Datashare platform is designed to function effectively by utilizing a combination of various services. To streamline the development and deployment workflows, Datashare relies on the use of Docker containers. Docker provides a lightweight and efficient way to package and distribute software applications, making it easier to manage dependencies and ensure consistency across different environments.

Starting Datashare with a single container

To start Datashare within a Docker container, you can use this command:
docker run --mount src=$HOME/Datashare,target=/home/datashare/data,type=bind -p 8080:8080 icij/datashare:11.1.9 --mode EMBEDDED
Make sure the Datashare folder exists in your homedir or this command will fail. This is an example about how to use Datashare with Docker, data will not be persisted.

Starting Datashare with multiple containers

Within Datashare, Docker Compose can play a significant role in enabling the setup of separated and persistent services for essential components such as the database (PostgreSQL), the search index (Elasticsearch), and the key-value store (Redis).
By utilizing Docker Compose, you can define and manage multiple containers as part of a unified service. This allows for seamless orchestration and deployment of interconnected services, each serving a specific purpose within the Datashare ecosystem.
Specifically, Docker Compose allows you to configure and launch separate containers for PostgreSQL, Elasticsearch, and Redis. These containers can be set up in a way that ensures their data is persistently stored, meaning that any information or changes made to the database, search index, or key-value store will be retained even if the containers are restarted or redeployed.
This separation of services using Docker Compose provides several advantages. It enhances modularity, scalability, and maintainability within the Datashare platform. It allows for independent management and scaling of each service, facilitating efficient resource utilization and enabling seamless upgrades or replacements of individual components as needed.
To start Datashare with Docker Compose, you can use the following docker-compose.yml file:
version: "3.7"
image: icij/datashare:13.9.0
hostname: datashare
- 8080:8080
- DS_DOCKER_MOUNTED_DATA_DIR=/home/datashare/data
- type: bind
source: ${HOME}/Datashare
target: /home/datashare/data
- type: volume
source: datashare-models
target: /home/datashare/dist
command: >-
--dataSourceUrl jdbc:postgresql://postgresql/datashare?user=datashare\&password=password
--mode LOCAL
--tcpListenPort 8080
- postgresql
- redis
- elasticsearch
restart: on-failure
- type: volume
source: elasticsearch-data
target: /usr/share/elasticsearch/data
read_only: false
- ""
- ""
- ""
- "discovery.type=single-node"
- "discovery.zen.minimum_master_nodes=1"
- "xpack.license.self_generated.type=basic"
- "http.cors.enabled=true"
- "http.cors.allow-origin=*"
- "http.cors.allow-methods=OPTIONS, HEAD, GET, POST, PUT, DELETE"
image: redis:4.0.1-alpine
restart: on-failure
image: postgres:12-alpine
- POSTGRES_USER=datashare
- POSTGRES_DB=datashare
- type: volume
source: postgresql-data
target: /var/lib/postgresql/data
Open a terminal or command prompt and navigate to the directory where you saved the docker-compose.yml file. Then run the following command to start the Datashare service:
docker-compose up -d
The -d flag runs the containers in detached mode, allowing them to run in the background.
Docker Compose will pull the necessary Docker images (if not already present) and start the containers defined in the YAML file. Datashare will take a few seconds to start. You can check the progression of this opperation with:
docker-compose logs -f datashare
Once the containers are up and running, you can access the Datashare service by opening a web browser and entering http://localhost:8080. This assumes that the default port mapping of 8080:8080 is used for the Datashare container in the YAML file.
That's it! You should now have the Datashare service up and running, accessible through your web browser. Remember that the containers will continue to run until you explicitly stop them.
To stop the Datashare service and remove the containers, you can run the following command in the same directory where the docker-compose.yml file is located:
docker-compose down
This will stop and remove the containers, freeing up system resources.
Last modified 1mo ago