From 5427e992e35b48de02cd8b987353a3454de8e62e Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Tue, 1 Feb 2022 12:35:46 -0500 Subject: [PATCH 1/5] bin changes --- bin/dev | 2 +- bin/prod | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/dev b/bin/dev index 94d7a5db..e1dad1ce 100644 --- a/bin/dev +++ b/bin/dev @@ -3,6 +3,6 @@ const startServer = require("./www"); const serverPort = 3005; -const initialClient = ""; +const initialClient = "http://localhost:8080/test-ehr/r4"; startServer(serverPort, initialClient); \ No newline at end of file diff --git a/bin/prod b/bin/prod index 94d7a5db..88b43721 100644 --- a/bin/prod +++ b/bin/prod @@ -2,7 +2,7 @@ const startServer = require("./www"); -const serverPort = 3005; -const initialClient = ""; +const serverPort = process.env.REACT_APP_SERVER_PORT ? process.env.RREACT_APP_SERVER_PORT : 3005; +const initialClient = process.env.REACT_APP_INITIAL_CLIENT ? process.env.REACT_APP_INITIAL_CLIENT : "http://localhost:8080/test-ehr/r4"; startServer(serverPort, initialClient); \ No newline at end of file From 80f6d0289a030e402af3e5c2776a226545cc188d Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Tue, 1 Feb 2022 12:38:47 -0500 Subject: [PATCH 2/5] bin changes bug fix --- bin/dev | 2 +- bin/prod | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/dev b/bin/dev index e1dad1ce..0d61bda8 100644 --- a/bin/dev +++ b/bin/dev @@ -3,6 +3,6 @@ const startServer = require("./www"); const serverPort = 3005; -const initialClient = "http://localhost:8080/test-ehr/r4"; +const initialClient = "http://localhost:8080/test-ehr/r4::app-login"; startServer(serverPort, initialClient); \ No newline at end of file diff --git a/bin/prod b/bin/prod index 88b43721..9f01282b 100644 --- a/bin/prod +++ b/bin/prod @@ -2,7 +2,7 @@ const startServer = require("./www"); -const serverPort = process.env.REACT_APP_SERVER_PORT ? process.env.RREACT_APP_SERVER_PORT : 3005; -const initialClient = process.env.REACT_APP_INITIAL_CLIENT ? process.env.REACT_APP_INITIAL_CLIENT : "http://localhost:8080/test-ehr/r4"; +const serverPort = process.env.REACT_APP_SERVER_PORT ? process.env.REACT_APP_SERVER_PORT : 3005; +const initialClient = process.env.REACT_APP_INITIAL_CLIENT ? process.env.REACT_APP_INITIAL_CLIENT : "http://localhost:8080/test-ehr/r4::app-login"; startServer(serverPort, initialClient); \ No newline at end of file From 3263a2530041d26d5dd153a4a7b23ec335770fce Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Wed, 9 Feb 2022 09:52:34 -0500 Subject: [PATCH 3/5] debugger --- .vscode/launch.json | 48 +++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- Dockerfile.dev | 3 ++- package.json | 2 +- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..e22e83c5 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,48 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Debug DTR Backend (Docker)", + "port": 3006, + "request": "attach", + "skipFiles": [ + "/**" + ], + "type": "node", + "localRoot": "${workspaceFolder}", + "remoteRoot": "/home/node/app/dtr", + "restart": true + }, + { + "name": "Debug DTR Backend (Local)", + "port": 3006, + "request": "attach", + "skipFiles": [ + "/**" + ], + "type": "node", + "restart": true + }, + { + "type": "chrome", + "request": "launch", + "name": "Debug DTR Frontend (Launch Local + Docker)", + "url": "http://localhost:3005/register", + "webRoot": "${workspaceFolder}", + "runtimeArgs": [ + "--remote-debugging-port=9222" + ] + }, + { + "type": "chrome", + "request": "attach", // Launch Chrome According To: https://github.com/microsoft/vscode-chrome-debug#attach + "name": "Debug DTR Frontend (Attach Local + Docker)", + "url": "http://localhost:3005/*", + "port": 9222, + "webRoot": "${workspaceFolder}", + } + ] +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0b9fe698..e418d57a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM node:14-alpine -WORKDIR /home/node/app +WORKDIR /home/node/app/dtr COPY --chown=node:node . . RUN npm install EXPOSE 3005 diff --git a/Dockerfile.dev b/Dockerfile.dev index c41c8844..63225412 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,6 +1,7 @@ FROM node:14-alpine -WORKDIR /home/node/app +WORKDIR /home/node/app/dtr COPY --chown=node:node . . RUN npm install EXPOSE 3005 +EXPOSE 3006 CMD ./dockerRunnerDev.sh diff --git a/package.json b/package.json index ee3a3032..3ac36c7b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "buildFrontendDev": "webpack --config ./webpack.config.js", "startBackendProd": "node ./bin/prod", "startBackendTemplate": "node ./bin/template", - "startBackendDev": "nodemon --watch public ./bin/dev", + "startBackendDev": "nodemon --inspect=0.0.0.0:3006 --watch public ./bin/dev ", "lint": "node ./node_modules/.bin/eslint --ext .js ./" }, "devDependencies": { From 29fbe87c482f3088220d85920b94e31b65fde2ab Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Wed, 9 Feb 2022 10:37:09 -0500 Subject: [PATCH 4/5] use prod start script in prod dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e418d57a..de965da5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,4 +3,4 @@ WORKDIR /home/node/app/dtr COPY --chown=node:node . . RUN npm install EXPOSE 3005 -CMD npm run start \ No newline at end of file +CMD npm run startProd \ No newline at end of file From 6451dd2ea5a993fe863461ecc302663c0c1e151c Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Fri, 11 Feb 2022 12:03:00 -0500 Subject: [PATCH 5/5] docker ignore --- .dockerignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..65d599df --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +node_modules +logs +databaseData \ No newline at end of file