Skip to content

Commit d0db917

Browse files
committed
Initial commit
0 parents  commit d0db917

File tree

4 files changed

+160
-0
lines changed

4 files changed

+160
-0
lines changed

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM openjdk:8-jre-alpine
2+
MAINTAINER Justin Menga <[email protected]>
3+
LABEL application=microtrader
4+
5+
# Install system dependencies
6+
RUN apk add --update --no-cache bash curl
7+
8+
# Set entrypoint and default command arguments
9+
COPY cluster.xml /app/conf/cluster.xml
10+
COPY entrypoint.sh /app/entrypoint.sh
11+
ENTRYPOINT ["/app/entrypoint.sh"]
12+
CMD ["java", "-jar", "/app/app.jar", "-server", "-cluster", "-Dvertx.hazelcast.config=/app/conf/cluster.xml"]

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Docker in Production using AWS - Microtrader Base Image
2+
3+
This provides the base Docker image for sample applications included with the Pluralsight course Docker in Production using Amazon Web Services.
4+
5+
## Quick Start
6+
7+
To build this image:
8+
9+
```
10+
$ docker build -t <org-name>/microtrader-base .
11+
```

cluster.xml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.2.xsd"
3+
xmlns="http://www.hazelcast.com/schema/config"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
<properties>
6+
<property name="hazelcast.mancenter.enabled">false</property>
7+
<property name="hazelcast.memcache.enabled">false</property>
8+
<property name="hazelcast.rest.enabled">false</property>
9+
<property name="hazelcast.wait.seconds.before.join">0</property>
10+
<property name="hazelcast.max.no.heartbeat.seconds">10</property>
11+
</properties>
12+
13+
<group>
14+
<name>microtrader</name>
15+
<password>password</password>
16+
</group>
17+
18+
<management-center enabled="false">http://localhost:8080/mancenter</management-center>
19+
<network>
20+
<port auto-increment="true" port-count="10000">5701</port>
21+
<outbound-ports>
22+
<!--
23+
Allowed port range when connecting to other nodes.
24+
0 or * means use system provided port.
25+
-->
26+
<ports>0</ports>
27+
</outbound-ports>
28+
<join>
29+
<multicast enabled="true"/>
30+
<tcp-ip enabled="false">
31+
<interface>127.0.0.1</interface>
32+
</tcp-ip>
33+
</join>
34+
<interfaces enabled="false">
35+
<interface>10.10.1.*</interface>
36+
</interfaces>
37+
<ssl enabled="false"/>
38+
<socket-interceptor enabled="false"/>
39+
<symmetric-encryption enabled="false">
40+
<!--
41+
encryption algorithm such as
42+
DES/ECB/PKCS5Padding,
43+
PBEWithMD5AndDES,
44+
AES/CBC/PKCS5Padding,
45+
Blowfish,
46+
DESede
47+
-->
48+
<algorithm>PBEWithMD5AndDES</algorithm>
49+
<!-- salt value to use when generating the secret key -->
50+
<salt>thesalt</salt>
51+
<!-- pass phrase to use when generating the secret key -->
52+
<password>thepass</password>
53+
<!-- iteration count to use when generating the secret key -->
54+
<iteration-count>19</iteration-count>
55+
</symmetric-encryption>
56+
</network>
57+
<partition-group enabled="false"/>
58+
<executor-service name="default">
59+
<pool-size>16</pool-size>
60+
<!--Queue capacity. 0 means Integer.MAX_VALUE.-->
61+
<queue-capacity>0</queue-capacity>
62+
</executor-service>
63+
<map name="__vertx.subs">
64+
65+
<!--
66+
Number of backups. If 1 is set as the backup-count for example,
67+
then all entries of the map will be copied to another JVM for
68+
fail-safety. 0 means no backup.
69+
-->
70+
<backup-count>1</backup-count>
71+
<!--
72+
Maximum number of seconds for each entry to stay in the map. Entries that are
73+
older than <time-to-live-seconds> and not updated for <time-to-live-seconds>
74+
will get automatically evicted from the map.
75+
Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0.
76+
-->
77+
<time-to-live-seconds>0</time-to-live-seconds>
78+
<!--
79+
Maximum number of seconds for each entry to stay idle in the map. Entries that are
80+
idle(not touched) for more than <max-idle-seconds> will get
81+
automatically evicted from the map. Entry is touched if get, put or containsKey is called.
82+
Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0.
83+
-->
84+
<max-idle-seconds>0</max-idle-seconds>
85+
<!--
86+
Valid values are:
87+
NONE (no eviction),
88+
LRU (Least Recently Used),
89+
LFU (Least Frequently Used).
90+
NONE is the default.
91+
-->
92+
<eviction-policy>NONE</eviction-policy>
93+
<!--
94+
Maximum size of the map. When max size is reached,
95+
map is evicted based on the policy defined.
96+
Any integer between 0 and Integer.MAX_VALUE. 0 means
97+
Integer.MAX_VALUE. Default is 0.
98+
-->
99+
<max-size policy="PER_NODE">0</max-size>
100+
<!--
101+
When max. size is reached, specified percentage of
102+
the map will be evicted. Any integer between 0 and 100.
103+
If 25 is set for example, 25% of the entries will
104+
get evicted.
105+
-->
106+
<eviction-percentage>25</eviction-percentage>
107+
<!--
108+
While recovering from split-brain (network partitioning),
109+
map entries in the small cluster will merge into the bigger cluster
110+
based on the policy set here. When an entry merge into the
111+
cluster, there might an existing entry with the same key already.
112+
Values of these entries might be different for that same key.
113+
Which value should be set for the key? Conflict is resolved by
114+
the policy set here. Default policy is PutIfAbsentMapMergePolicy
115+
There are built-in merge policies such as
116+
com.hazelcast.map.merge.PassThroughMergePolicy; entry will be added if there is no existing entry for the key.
117+
com.hazelcast.map.merge.PutIfAbsentMapMergePolicy ; entry will be added if the merging entry doesn't exist in the cluster.
118+
com.hazelcast.map.merge.HigherHitsMapMergePolicy ; entry with the higher hits wins.
119+
com.hazelcast.map.merge.LatestUpdateMapMergePolicy ; entry with the latest update wins.
120+
-->
121+
<merge-policy>com.hazelcast.map.merge.LatestUpdateMapMergePolicy</merge-policy>
122+
123+
</map>
124+
125+
<!-- Used internally in Vert.x to implement async locks -->
126+
<semaphore name="__vertx.*">
127+
<initial-permits>1</initial-permits>
128+
</semaphore>
129+
130+
</hazelcast>

entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Add initialisation logic here
5+
6+
# Run application
7+
exec "$@"

0 commit comments

Comments
 (0)