| 
1 |  | -# openIMIS dockerized  | 
 | 1 | +<center>  | 
 | 2 | +<img src="https://openimis.org/themes/custom/ffw/logo.svg" width="200px" alt="openIMIS logo" />  | 
 | 3 | +</center>  | 
2 | 4 | 
 
  | 
3 |  | - This repository provides a Docker package for openIMIS that includes all components to quickly setup, test and demo the solution.  | 
4 |  | -   | 
 | 5 | +# openIMIS Distribution  | 
5 | 6 | 
 
  | 
6 |  | - 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  | 
 | 7 | +This repository provides configuration files for deploying openIMIS via Docker. This is intended to help you setup all components to quickly setup, test and evaluate the solution.  | 
7 | 8 | 
 
  | 
8 |  | -   | 
9 |  | - The openIMIS docker compose currently includes the database, backend and worker, frontend, and third parties components (Lightning, OpenSearch, RabbitMQ, etc.).  | 
10 |  | -   | 
 | 9 | +Detailed instructions are in our Wiki: [Installation Guide](https://openimis.atlassian.net/wiki/spaces/OP/pages/963182705/MO1.1+Install+the+modular+openIMIS+using+Docker)  | 
11 | 10 | 
 
  | 
12 |  | -In case of troubles, please contact our service desk via our [ticketing platform](https://openimis.atlassian.net/servicedesk/customer).  | 
13 |  | - | 
14 |  | -## Prerequisite  | 
15 |  | - | 
16 |  | -* Docker installed  | 
17 |  | - | 
18 |  | -## Fast lane  | 
19 |  | - | 
20 |  | -You can use the script `deploy_openimis.sh` to initialise all components (uses PostgreSQL DB).  | 
21 |  | - | 
22 |  | -## First startup  | 
23 |  | - | 
24 |  | -* Copy `.env.example` to `.env` and make the necessary adjustments.  | 
25 |  | -* 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`).   | 
26 |  | -* 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.  | 
27 |  | - | 
28 |  | -## OpenFN/Lightning setup   | 
29 |  | - | 
30 |  | -If the implementation involves managing the social protection workflow/import, then OpenFN/Lightning must be set up with the following steps:  | 
31 |  | - | 
32 |  | -* Copy `.env.lightning.example` to `.env.lightning` and make the necessary adjustments.  | 
33 |  | -* Create the `lightning_dev` database in the database container.  | 
34 |  | -* Build the container: `docker compose -f docker-compose.yml -f docker-compose.lightning.yml build lightning`.  | 
35 |  | -* Run migrations: `docker compose -f docker-compose.yml -f docker-compose.lightning.yml run --rm lightning mix ecto.migrate`.  | 
36 |  | -* Set up the IMIS demo: `docker compose -f docker-compose.yml -f docker-compose.lightning.yml run --rm lightning ./imisSetup.sh`.  | 
37 |  | -* Start the service: `docker compose -f docker-compose.yml -f docker-compose.lightning.yml up lightning`.  | 
38 |  | - | 
39 |  | -## OpenSearch/OpenSearch Dashboards setup   | 
40 |  | - | 
41 |  | -Both OpenSearch and OpenSearch Dashboards are not by default enabled in dockerized instance. To make them work, it's required to:   | 
42 |  | - | 
43 |  | -  * Copy `.env.openSearch.example` to `.env.openSearch` and make adjustments  | 
44 |  | -  * Run container build `docker compose -f docker-compose.yml -f docker-compose.openSearch.yml build opensearch opensearch-dashboards nginx`  | 
45 |  | -  * Run service `docker compose -f docker-compose.yml -f docker-compose.openSearch.yml up opensearch opensearch-dashboards nginx`  | 
46 |  | - | 
47 |  | -This build provides also additional nginx proxy server in order to handle OpenSearch Dashboard application on frontend level.   | 
48 |  | - | 
49 |  | -To run on a dockerized instance of openIMIS (database, backend, and frontend), including OpenSearch, please follow the steps below:  | 
50 |  | - | 
51 |  | -  * 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.  | 
52 |  | -  * In the `.env` file in openimis-fe_js, use the following environment variable: `ENV OPENSEARCH_PROXY_ROOT="opensearch"`.  | 
53 |  | -  * Run the backend and frontend services.  | 
54 |  | - | 
55 |  | -## Run openIMIS with Docker  | 
56 |  | - | 
57 |  | -You can run the docker compose commands from within `openimis-dist_dkr` folder.  | 
58 |  | - | 
59 |  | -### Pull new images  | 
60 |  | - | 
61 |  | -To pull new images or images update `docker-compose pull`   | 
62 |  | - | 
63 |  | -### Start / Stop  | 
64 |  | - | 
65 |  | -* To start or restart all docker containers: `docker-compose start`   | 
66 |  | -* To stop all docker containers: `docker-compose stop`  | 
67 |  | - | 
68 |  | -## Create LetsEncrypt certificates  | 
69 |  | - | 
70 |  | -Use the certbot docker compose file.   | 
71 |  | - | 
72 |  | -`export DOMAIN [domain_name]`  | 
73 |  | - | 
74 |  | -### Dry run   | 
75 |  | - | 
76 |  | -`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`  | 
77 |  | - | 
78 |  | -### Actual setup  | 
79 |  | - | 
80 |  | -`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`  | 
81 |  | - | 
82 |  | - | 
83 |  | -## Run integration tests  | 
84 |  | - | 
85 |  | -Integration tests live in the `/cypress` folder of this repo.  | 
86 |  | - | 
87 |  | -### Requirements  | 
88 |  | - | 
89 |  | -Ensure npm is installed, then install the required dependencies:  | 
90 |  | - | 
91 |  | -`npm install`  | 
92 |  | - | 
93 |  | -### Run e2e tests against local docker containers  | 
94 |  | - | 
95 |  | -Make sure all expected containers are running: `docker ps`;  | 
96 |  | -if not, start them with `docker compose start`. Then run tests:  | 
97 |  | - | 
98 |  | -Headless: `npx cypress run`  | 
99 |  | -Headed: `npx cypress open` or `npm run cy:open`  | 
100 |  | - | 
101 |  | -### Run e2e tests against any local or remote url  | 
102 |  | - | 
103 |  | -This can be useful for local development or verifying a staging deployment,  | 
104 |  | -for example, if the target host is localhost:3000,  | 
105 |  | -pass it into the corresponding test command with `-- --config "baseUrl=http://localhost:3000"`:  | 
106 |  | - | 
107 |  | -- Headless: `npx cypress run --config "baseUrl=http://localhost:3000"`  | 
108 |  | -- Headed: `npx cypress open --config "baseUrl=http://localhost:3000"`  | 
0 commit comments