Skip to content

Commit c76e2f4

Browse files
Merge pull request #6 from OpenLMIS/5.2.15-SNAPSHOT
Fix build, stabilize consul registration and health checks
2 parents b94aceb + 9d602e6 commit c76e2f4

8 files changed

Lines changed: 2048 additions & 390 deletions

File tree

Dockerfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
FROM nginx:1.24.0
22

3-
ADD nginx.conf /etc/nginx/conf.d/default.conf
3+
ADD nginx.conf /etc/nginx/conf.d/default.conf
44

55
COPY /build/webapp /usr/share/nginx/html
66
COPY /consul /consul
77
COPY run.sh /run.sh
88

9-
RUN chmod +x run.sh \
10-
&& apt-get update \
11-
&& apt-get install -y curl gnupg \
12-
&& curl -sL https://deb.nodesource.com/setup_12.x | bash - \
13-
&& apt-get install -y nodejs \
14-
&& apt-get install -y gettext \
15-
&& mv consul/package.json package.json \
16-
&& npm install
9+
RUN chmod +x run.sh
10+
COPY --from=node:12-bullseye /usr/local/bin/node /usr/local/bin/node
11+
COPY --from=node:12-bullseye /usr/local/lib/node_modules /usr/local/lib/node_modules
12+
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
13+
ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx
1714

18-
CMD ./run.sh
15+
RUN apt-get update && apt-get install -y gettext
16+
RUN mv consul/package.json package.json
17+
RUN npm install
18+
19+
CMD ["./run.sh"]

consul/config.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
{
22
"service": {
33
"Name": "reference-ui",
4+
"Id": "reference-ui-service",
45
"Port": 80,
5-
"Tags": ["openlmis-service"]
6+
"Tags": ["openlmis-service"],
7+
"check": {
8+
"interval": "30s",
9+
"http": "http://HOST:PORT/",
10+
"timeout": "5s",
11+
"deregisterCriticalServiceAfter": "10m"
12+
}
613
},
714
"path": [
8-
"",
15+
"/",
916
"<all>"
1017
]
1118
}

consul/package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"name": "openlmis-consul-registration",
3-
"version": "0.0.1",
4-
5-
"devDependencies":
6-
{
7-
"uuid": "~3.0.0",
8-
"raml-parser": "~0.8.0",
9-
"command-line-args": "~3.0.0",
10-
"system-sleep": "~1.0.0",
11-
"deasync": "~0.1.9",
12-
"ip": "~1.1.0"
3+
"version": "1.0.0",
4+
"description": "Registration script for OpenLMIS Service",
5+
"main": "registration.js",
6+
"dependencies": {
7+
"axios": "^1.6.0",
8+
"command-line-args": "^5.2.1",
9+
"ip": "^1.1.8",
10+
"raml-parser": "~0.8.18",
11+
"uuid": "^9.0.0"
12+
},
13+
"engines": {
14+
"node": ">=18"
1315
}
14-
}
16+
}

0 commit comments

Comments
 (0)