Skip to content

Commit bbbc22f

Browse files
committed
Issue 40 add examples from other open source projects
Signed-off-by: Jon Bartels <jon.bartels@teladochealth.com>
1 parent 65df215 commit bbbc22f

File tree

14 files changed

+353
-0
lines changed

14 files changed

+353
-0
lines changed

examples/README.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Examples
2+
3+
* [postgres-with-volume.yml](#postgres-with-volume.yml)
4+
* [mysql-with-volume.yml](#mysql-with-volume.yml)
5+
* [derby-with-volumes-and-secrets.yml](#derby-with-volumes-and-secrets.yml)
6+
* [postgres-with-2-connect-servers-in-cluster.yml](#postgres-with-2-connect-servers-in-cluster.yml)
7+
* [play-with-docker-example.yml](#play-with-docker-example.yml)
8+
9+
------------
10+
11+
<a name="postgres-with-volume.yml"></a>
12+
### postgres-with-volume.yml
13+
14+
This stack launches Open Integration Engine along with a PostgreSQL database. It also mounts a volume for the appdata folder so that the server ID / keystore file are preserved.
15+
16+
If you want you can edit the stack file and change the location of the appdata volume:
17+
18+
```yaml
19+
volumes:
20+
- ./data/volumes/appdata:/opt/connect/appdata
21+
```
22+
23+
Then use [docker-compose](https://docs.docker.com/compose/) to launch:
24+
25+
```bash
26+
docker-compose -f examples/postgres-with-volume.yml up
27+
```
28+
29+
------------
30+
31+
<a name="mysql-with-volume.yml"></a>
32+
### mysql-with-volume.yml
33+
34+
This stack launches Open Integration Engine along with a MySQL database. It also mounts a volume for the appdata folder so that the server ID / keystore file are preserved.
35+
36+
If you want you can edit the stack file and change the location of the appdata volume:
37+
38+
```yaml
39+
volumes:
40+
- ./data/volumes/appdata:/opt/connect/appdata
41+
```
42+
43+
Then use [docker-compose](https://docs.docker.com/compose/) to launch:
44+
45+
```bash
46+
docker-compose -f examples/mysql-with-volume.yml up
47+
```
48+
49+
------------
50+
51+
<a name="derby-with-volumes-and-secrets.yml"></a>
52+
### derby-with-volumes-and-secrets.yml
53+
54+
This stack launches Open Integration Engine using its embedded Apache Derby database. It mounts a volume for the appdata folder so that the Derby database, server ID, and keystore file are preserved. It also mounts another `custom-extensions` volume to allow additional extensions to be automatically installed. This file also demonstrates how to use [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/) with docker-compose.
55+
56+
Some examples of extensions available are:
57+
* [Git Integration from BrightCode](https://brightcodecompany.com/)
58+
* [Code Template References from Kiran Ayyagari](https://github.com/kayyagari/ct-refs)
59+
* [SSL Extension from Zen Healthcare IT](https://consultzen.com/)
60+
61+
If you want you can edit the stack file and change the volume/secret locations:
62+
63+
```yaml
64+
volumes:
65+
- ./data/volumes/appdata:/opt/connect/appdata
66+
- ./data/volumes/custom-extensions:/opt/connect/custom-extensions
67+
```
68+
69+
```yaml
70+
secrets:
71+
mirth_properties:
72+
file: ./data/secret.properties
73+
mcserver_vmoptions:
74+
file: ./data/secret.vmoptions
75+
```
76+
77+
To test installing an extension, you can download the [FHIR Connector](https://www.mirthcorp.com/community/wiki/pages/viewpage.action?pageId=36504815) extension and place the ZIP file into the `examples/data/volumes/custom-extensions` folder.
78+
79+
Any properties you put in the `examples/data/secret.properties` file will be merged into mirth.properties. By default this file contains:
80+
81+
```bash
82+
keystore.storepass = docker_storepass
83+
keystore.keypass = docker_keypass
84+
```
85+
86+
Any entries you put in the `examples/data/secret.vmoptions` file will be appended to the `mcserver.vmoptions` file inside the container. You can use this to set sensitive Java System properties like so:
87+
88+
```bash
89+
-Dmy.secret.property=thepassword
90+
```
91+
92+
Finally, use [docker-compose](https://docs.docker.com/compose/) to launch:
93+
94+
```bash
95+
docker-compose -f examples/derby-with-volumes-and-secrets.yml up
96+
```
97+
98+
------------
99+
100+
<a name="postgres-with-2-connect-servers-in-cluster.yml"></a>
101+
### postgres-with-2-connect-servers-in-cluster.yml
102+
103+
This stack launches two clustered Open Integration Engine servers along with a PostgreSQL database. It mounts volumes for the appdata folders for both servers, and also launches a load balancer ([HAProxy](https://hub.docker.com/_/haproxy)) to forward requests to both Open Integration Engine servers.
104+
105+
If you want you can edit the stack file and change the volume locations:
106+
107+
```yaml
108+
volumes:
109+
- ./data/volumes/appdata1:/opt/connect/appdata
110+
...
111+
volumes:
112+
- ./data/volumes/appdata2:/opt/connect/appdata
113+
```
114+
115+
Then use [docker-compose](https://docs.docker.com/compose/) to launch:
116+
117+
```bash
118+
docker-compose -f examples/postgres-with-2-connect-servers-in-cluster.yml up
119+
```
120+
121+
Once both servers come online, you can login using the Administrator GUI to the load balanced 8443 port, or you can login specifically to the `mc1` node on the 8441 port, or the `mc2` node on the 8442 port.
122+
123+
The environment also load balances on port 9001, so you can test by creating an HTTP Listener channel on that port and deploying it on both servers. Then you can send requests to `http://localhost:9001` on your local workstation, and you should see that the requests get round-robin load balanced to both servers.
124+
125+
------------
126+
127+
<a name="play-with-docker-example.yml"></a>
128+
### play-with-docker-example.yml
129+
130+
This example file can be used to launch a Open Integration Engine instance and PostgreSQL database using the [Play With Docker](https://github.com/play-with-docker/play-with-docker) framework. Just click the button below to launch:
131+
132+
[![Try in PWD](https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png)](http://play-with-docker.com/?stack=https://raw.githubusercontent.com/nextgenhealthcare/connect-docker/master/examples/play-with-docker-example.yml)
133+
134+
Note that in order to access the 8080/8443 ports from your workstation, follow [their guide](https://github.com/play-with-docker/play-with-docker#how-can-i-connect-to-a-published-port-from-the-outside-world) to format the URL correctly. When you login via the Administrator GUI, use port 443 on the end instead of 8443.

examples/data/secret.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
keystore.storepass = docker_storepass
2+
keystore.keypass = docker_keypass

examples/data/secret.vmoptions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Dmy.secret.property=thepassword

examples/data/volumes/appdata/.keep

Whitespace-only changes.

examples/data/volumes/appdata1/.keep

Whitespace-only changes.

examples/data/volumes/appdata2/.keep

Whitespace-only changes.

examples/data/volumes/custom-extensions/.keep

Whitespace-only changes.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
defaults
2+
mode tcp
3+
option log-health-checks
4+
option redispatch
5+
retries 3
6+
timeout queue 1m
7+
timeout connect 10s
8+
timeout client 1m
9+
timeout server 1m
10+
timeout check 10s
11+
maxconn 3000
12+
13+
backend mcserver-http
14+
balance roundrobin
15+
server mc1-http mc1:8080 check
16+
server mc2-http mc2:8080 check
17+
18+
frontend mc-http
19+
bind *:8080
20+
default_backend mcserver-http
21+
22+
backend mcserver-https
23+
balance roundrobin
24+
server mc1-https mc1:8443 check
25+
server mc2-https mc2:8443 check
26+
27+
frontend mc-https
28+
bind *:8443
29+
default_backend mcserver-https
30+
31+
backend mcserver-9001
32+
balance roundrobin
33+
server mc1-9001 mc1:9001 check
34+
server mc2-9001 mc2:9001 check
35+
36+
frontend mc-9001
37+
bind *:9001
38+
default_backend mcserver-9001
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: "3.1"
2+
services:
3+
mc:
4+
image: openintegrationengine/engine
5+
environment:
6+
- VMOPTIONS=-Xmx512m
7+
volumes:
8+
- ./data/volumes/appdata:/opt/connect/appdata
9+
- ./data/volumes/custom-extensions:/opt/connect/custom-extensions
10+
secrets:
11+
- mirth_properties
12+
- mcserver_vmoptions
13+
ports:
14+
- 8080:8080/tcp
15+
- 8443:8443/tcp
16+
17+
secrets:
18+
mirth_properties:
19+
file: ./data/secret.properties
20+
mcserver_vmoptions:
21+
file: ./data/secret.vmoptions

examples/example.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DATABASE=postgres
2+
DATABASE_URL=jdbc:postgresql://host.docker.internal:5432/mirthdb
3+
DATABASE_MAX_CONNECTIONS=20
4+
DATABASE_USERNAME=mirthdb
5+
DATABASE_PASSWORD=mirthdb
6+
KEYSTORE_STOREPASS=docker_storepass
7+
KEYSTORE_KEYPASS=docker_keypass
8+
VMOPTIONS=-Xmx512m

0 commit comments

Comments
 (0)