Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Jan 24, 2024
2 parents 9d05e94 + d8b5add commit 36d9e9d
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 1,472 deletions.
25 changes: 17 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
FROM keymetrics/pm2:16-slim
FROM eclipse-temurin:17-jdk-jammy

# Install JDK
RUN apt update && apt install openjdk-11-jdk-headless make g++ python3 -y
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

ENV NODE_VERSION 18.17.0

# Installing Node
SHELL ["/bin/bash", "--login", "-i", "-c"]
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
RUN source /root/.bashrc && nvm install $NODE_VERSION
RUN n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; cp -r $n/{bin,lib,share} /usr/local
SHELL ["/bin/bash", "--login", "-c"]

WORKDIR /
RUN mkdir -p /nodejs/fhir-burni/
RUN chown -R node:node /nodejs
WORKDIR /nodejs/fhir-burni/
# Bundle APP files
COPY --chown=node:node package*.json /nodejs/fhir-burni/
COPY --chown=node:node . /nodejs/fhir-burni/
COPY package*.json /nodejs/fhir-burni/
COPY . /nodejs/fhir-burni/

# Install app dependencies
ENV NPM_CONFIG_LOGLEVEL warn
ENV NODE_ENV production
RUN npm i -g pm2
RUN npm ci --only=production
RUN node config/generate-config-allResources.js
RUN npm run build

# Show current folder structure in logs
#RUN ls -al -R
USER node
CMD [ "pm2-runtime", "start", "ecosystem.config.js", "--node-args=\"--max-old-space-size=4096\""]
1 change: 0 additions & 1 deletion FHIR-mongoose-Models-Generator/resourceGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ function generateResourceSchema(type) {

// let importLib = "const mongoose = require('mongoose');\r\nconst moment = require('moment');\r\nconst _ = require('lodash');\r\n";
let code = `module.exports = function () {
require('mongoose-schema-jsonschema')(mongoose);
const ${type} = ${JSON.stringify(result, null, 4)
.replace(/\"/gm, "")
.replace(/\\/gm, '"')};\r\n
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.4'
services:
fhir-burni-mongodb:
image: mongo:4.2
image: mongo:7.0
container_name : fhir-burni-mongodb
restart: always
ports:
Expand All @@ -20,7 +20,7 @@ services:
container_name: fhir-burni
command: >
/bin/sh -c '
while ! nc -z fhir-burni-mongodb 27017;
while ! echo >/dev/tcp/fhir-burni-mongodb/27017;
do
echo "waiting for database ...";
sleep 3;
Expand Down
1 change: 0 additions & 1 deletion models/mongodb/model/Patient.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const {
checkResourceHaveReferenceByOthers
} = require("../common");
module.exports = function() {
require('mongoose-schema-jsonschema')(mongoose);
const Patient = {
meta: {
type: Meta,
Expand Down
Loading

0 comments on commit 36d9e9d

Please sign in to comment.