-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify installation with docker #64
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
**/.env | ||
openimis_env/* | ||
data/* | ||
openimis-dist_dkr.code-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,80 @@ | ||
# openIMIS dockerized | ||
|
||
This repository provides a dockerized openIMIS (all components) as a quick setup , testing or demoing. | ||
This repository provides a Docker package for openIMIS that includes all components to quickly setup, test and demo the solution. | ||
|
||
|
||
Please look for further instructions on the openIMIS Wiki: https://openimis.atlassian.net/wiki/spaces/OP/pages/963182705/MO1.1+Install+the+modular+openIMIS+using+Docker | ||
|
||
|
||
The docker-compose currently contains the openIMIS database, backend + worker, frontend, and third parties components (lightning, opensearch, rabitMQ ... ). | ||
The openIMIS docker compose currently includes the database, backend and worker, frontend, and third parties components (Lightning, OpenSearch, RabbitMQ, etc.). | ||
|
||
|
||
In case of troubles, please consult/contact our service desk via our [ticketing site](https://openimis.atlassian.net/servicedesk/customer). | ||
In case of troubles, please contact our service desk via our [ticketing platform](https://openimis.atlassian.net/servicedesk/customer). | ||
|
||
# Prerequisit | ||
- Docker installed | ||
## Prerequisite | ||
|
||
* Docker installed | ||
|
||
# fast lane | ||
## Fast lane | ||
|
||
You can use the script `deploy_openimis.sh`to initialize all components | ||
You can use the script `deploy_openimis.sh` to initialise all components (uses PostgreSQL DB). | ||
|
||
# First startup | ||
## First startup | ||
|
||
* create a `.env` file, use `.env.example` as starting point (respectivement for `.env.lightning`, `.env.openSearch`) | ||
* chose database vendor: the default is psql but you can edit the docker-compose.yml and change `docker-compose-psql.yml` to `docker-compose-mssql.yml` | ||
* Copy `.env.example` to `.env` and make the necessary adjustments. | ||
* Choose a database default system to use. The default is PostgreSQL (`DB_DEFAULT=postgresql`, `DB_PORT=5432`), but you can also use MSSQL (`DB_DEFAULT=mssql`, `DB_PORT=1433`, `ACCEPT_EULA=Y`). | ||
* Uncomment the line `DEMO_DATASET=true` in `.env` to initialise the database with the DEMO dataset. If you leave it commented, an empty openIMIS database will be created. | ||
|
||
## OpenFN/Lightning setup | ||
|
||
## configure the gateway (optionnal) | ||
|
||
* uncomment the volume in the frontend config | ||
* make modification in openimis.conf | ||
If the implementation involves managing the social protection workflow/import, then OpenFN/Lightning must be set up with the following steps: | ||
|
||
* Copy `.env.lightning.example` to `.env.lightning` and make the necessary adjustments. | ||
* Create the `lightning_dev` database in the database container. | ||
* Build the container: `docker compose -f docker-compose.yml -f docker-compose.lightning.yml build lightning`. | ||
* Run migrations: `docker compose -f docker-compose.yml -f docker-compose.lightning.yml run --rm lightning mix ecto.migrate`. | ||
* Set up the IMIS demo: `docker compose -f docker-compose.yml -f docker-compose.lightning.yml run --rm lightning ./imisSetup.sh`. | ||
* Start the service: `docker compose -f docker-compose.yml -f docker-compose.lightning.yml up lightning`. | ||
|
||
## main database initialisation | ||
|
||
Include the line INIT_MODE=demo in .env or uncomment it in case it has been copied from .env.example copied to intiate the database with the DEMO dataset, it will create an empty openIMIS database otherwise | ||
|
||
## OpenFN/Lightning setup ( manage social protection workflow/import ) | ||
## OpenSearch/OpenSearch Dashboards setup | ||
|
||
* Copy `.env.lightning.example` to `.env.lightning` and make adjustments | ||
* Create `lightning_dev` database in db container | ||
* Run container build `docker compose -f docker-compose.yml -f docker-compose.lightning.yml build lightning` | ||
* Run migrations `docker compose -f docker-compose.yml -f docker-compose.lightning.yml run --rm lightning mix ecto.migrate` | ||
* Run imis demo setup `docker compose -f docker-compose.yml -f docker-compose.lightning.yml run --rm lightning ./imisSetup.sh` | ||
* Run service `docker compose -f docker-compose.yml -f docker-compose.lightning.yml up lightning` | ||
Both OpenSearch and OpenSearch Dashboards are not by default enabled in dockerized instance. To make them work, it's required to: | ||
|
||
## OpenSearch/OpenSearch Dashboards setup | ||
Both OpenSearch and OpenSearch Dashboards are not by default enabled in dockerized instance. To make them work it's required to: | ||
* Copy `.env.openSearch.example` to `.env.openSearch` and make adjustments | ||
* Run container build `docker compose -f docker-compose.yml -f docker-compose.openSearch.yml build opensearch opensearch-dashboards nginx` | ||
* Run service `docker compose -f docker-compose.yml -f docker-compose.openSearch.yml up opensearch opensearch-dashboards nginx` | ||
This build provides also additional nginx proxy server in order to handle openSearch Dashboard application on frontend level. | ||
|
||
To run on a Dockerized instance (database, backend, and frontend of openIMIS), please follow the steps below: | ||
* Add a value for the OPENSEARCH_BASIC_TOKEN in the environment (env) file. This should be based on the admin and password credentials for openSearch. | ||
* In the .env file in openimis-fe_js, use the following environment variable: `ENV OPENSEARCH_PROXY_ROOT="opensearch"`. | ||
This build provides also additional nginx proxy server in order to handle OpenSearch Dashboard application on frontend level. | ||
|
||
To run on a dockerized instance of openIMIS (database, backend, and frontend), including OpenSearch, please follow the steps below: | ||
|
||
* Add a value for the OPENSEARCH_BASIC_TOKEN in the environment (`.env`) file. This should be based on the admin and password credentials for OpenSearch. | ||
* In the `.env` file in openimis-fe_js, use the following environment variable: `ENV OPENSEARCH_PROXY_ROOT="opensearch"`. | ||
* Run the backend and frontend services. | ||
|
||
# stop /start | ||
## Run openIMIS with Docker | ||
|
||
To stop all docker containers: `docker-compose stop` | ||
To (re-)start all docker containers: `docker-compose start` | ||
You can run the docker compose commands from within `openimis-dist_dkr` folder. | ||
|
||
# pull new images | ||
### Pull new images | ||
|
||
To pull new images or images update `docker-compose pull` | ||
|
||
### Start / Stop | ||
|
||
* To start or restart all docker containers: `docker-compose start` | ||
* To stop all docker containers: `docker-compose stop` | ||
|
||
# create lets encrypt certs | ||
## Create LetsEncrypt certificates | ||
|
||
use the certbot docker compose file | ||
Use the certbot docker compose file. | ||
|
||
export DOMAIN first | ||
`export DOMAIN [domain_name]` | ||
|
||
### Dry run | ||
|
||
## dry run | ||
docker-compose run --rm --entrypoint " certbot certonly --webroot -w /var/www/certbot --staging --register-unsafely-without-email -d ${DOMAIN} --rsa-key-size 2048 --agree-tos --force-renewal" certbot | ||
`docker-compose run --rm --entrypoint " certbot certonly --webroot -w /var/www/certbot --staging --register-unsafely-without-email -d ${DOMAIN} --rsa-key-size 2048 --agree-tos --force-renewal" certbot` | ||
|
||
## actual setup | ||
### Actual setup | ||
|
||
docker-compose run --rm --entrypoint " certbot certonly --webroot -w /var/www/certbot --register-unsafely-without-email -d ${DOMAIN} --rsa-key-size 2048 --agree-tos --force-renewal" certbot | ||
`docker-compose run --rm --entrypoint " certbot certonly --webroot -w /var/www/certbot --register-unsafely-without-email -d ${DOMAIN} --rsa-key-size 2048 --agree-tos --force-renewal" certbot` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove that