dockerizing_4dscience/README.md

187 lines
6.5 KiB
Markdown

# gCube System - Dockerized D4Science
## Version
version `v1.0.0`
## Structure of the project
This project provides a containerized environment for two primary services: `socialservice` and `liferay`, each supported by its specific infrastructure. The configuration allows the two infrastructures to be launched independently or together, and services can be started individually if desired.
## Built With
Docker
## Documentation
### GIT
the first time you check-out a repo you need to use --init
`git submodule update --init --recursive`
the other times
`git pull --recurse-submodules`
### Services
* **socialservice**: Located in `socialservice/`, this includes configurations and Docker setups for deploying a custom social networking service. It depends on Cassandra and Keycloak to handle database storage and identity management, respectively.
* [cassandra](./cassandra/README.md)
* [socialservice](./socialservice/README.md)
docker commands:
`docker compose up cassandra1 cassandra2 cassandra3 socialservice --build --force-recreate -d`
`docker compose stop cassandra1 cassandra2 cassandra3 socialservice`
* **liferay**: The `liferay/` directory contains all configurations and Dockerfiles required to deploy the Liferay content management platform, along with its supporting infrastructure like PostgreSQL.
* [postgres](./postgres/README.md)
* [keycloak](./keycloak/README.md)
* [liferay](./liferay/README.md)
docker commands:
`docker compose up postgres keycloak liferay --build --force-recreate -d`
`docker compose stop postgres keycloak liferay`
### Docker compose instructions
you can start the 2 services individually entering in the folder and starting the docker compose instance, or start the common compose in the base folder.
```bash
docker compose -f compose.yml up -d # Start
docker compose -f compose.yml build # Build
docker compose -f compose.yml stop # Stop
docker compose -f compose.yml down # Destroy
docker compose -f compose.yml ps # Check Status
```
start common composer:
`docker compose up -d`
force recreate docker image:
`docker compose build --no-cache`
you can force the build and/or reload:
`docker compose up --build --force-reloads -d`
check status:
* postgres: `docker inspect --format='{{json .State.Health}}' lr_docker-postgres-1`
* keycloak: `docker inspect --format='{{json .State.Health}}' lr_docker-keycloak-1`
* liferay: `docker inspect --format='{{json .State.Health}}' lr_docker-liferay-1`
* socialservice: `docker inspect --format='{{json .State.Health}}' lr_docker-socialservice`
* cassandara1: `docker inspect --format='{{json .State.Health}}' cassandra1`
* cassandara2: `docker inspect --format='{{json .State.Health}}' cassandra2`
* cassandara3: `docker inspect --format='{{json .State.Health}}' cassandra3`
open bash in instance:
* postgres: `docker exec -it lr_docker-postgres-1 /bin/sh`
* keycloak: `docker exec -it lr_docker-keycloak-1 /bin/sh`
* liferay: `docker exec -it lr_docker-liferay-1 /bin/sh`
* socialservice: `docker exec -it lr_docker socialservice /bin/sh`
* cassandra1: `docker exec -it lr_docker cassandra1 /bin/sh`
* cassandra2: `docker exec -it lr_docker cassandra2 /bin/sh`
* cassandra3: `docker exec -it lr_docker cassandra3 /bin/sh`
#### All services
`docker compose up --build *d`
`docker compose stop`
#### Social Service
`docker compose up cassandra1 cassandra2 cassandra3 socialservice --build *d`
`docker compose stop cassandra1 cassandra2 cassandra3 socialservice`
### Liferay service
`docker compose up postgres keycloak liferay --build *d`
`docker compose stop postgres keycloak liferay`
### Single components
#### cassandra
[cassandra](./cassandra/README.md) is the dockerization of the cassandra infrastructure
it contains the script for dumping the devel environment, and the [Dockerfile](./cassandra/Dockerfile) and [Docker compose](./cassandra/compose.yaml) files to build and start the composed instance with the dumped schema and data
`docker compose up cassandra1 cassandra2 cassandra3 --build *d`
`docker compose stop cassandra1 cassandra2 cassandra3`
check status:
* cassandara1
* `docker inspect --format='{{json .State.Health}}' cassandra1`
* `docker exec -it cassandra1 nodetool status`
* cassandara2
* `docker inspect --format='{{json .State.Health}}' cassandra2`
* `docker exec -it cassandra1 nodetool status`
* cassandara3
* `docker inspect --format='{{json .State.Health}}' cassandra3`
* `docker exec -it cassandra1 nodetool status`
#### socialservice
[socialservice](./socialservice/README.md) is the dockerization of the socialservice infrastructure
it contains the script for dumping the devel environment, and the [Dockerfile](./socialservice/Dockerfile) and [Docker compose](./socialservice/compose.yaml) files to build and start the composed instance with the dumped schema and data
#### Keycloak
[keycloack](./keycloack/README.md) is the dockerization of the keycloack authentication services. it contains the [Dockerfile](./socialservice/Dockerfile) and [Docker compose](./socialservice/compose.yaml) files to build and start the composed instance with the d4science.json data
### Liferay
to exec the liferay instance you need to to your host file (`/etc/host`) the entries:
```txt
127.0.0.1 keycloak
127.0.0.1 liferay
```
keycloak server: http://keycloak:9999
liferay server:
* http://liferay:80
* http://next.dev.d4science.org:80
open bash on server
check db connection:
`docker exec -it lr_docker-liferay-1 bash -c 'PGPASSWORD=pass_db psql -h lr_docker-postgres-1 -U infra_bundle_dev -d liferay_db'`
## Change log
See [Releases](https://code-repo.d4science.org/gCubeSystem/${project.artifactId}/releases).
## Authors
* **Alfredo Oliviero** ([ORCID]( https://orcid.org/0009-0007-3191-1025)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/A.Oliviero)
## Maintainers
* **Alfredo Oliviero** ([ORCID]( https://orcid.org/0009-0007-3191-1025)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/A.Oliviero)
## License
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
## About the gCube Framework
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an
open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)