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 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..de965da5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM node:14-alpine -WORKDIR /home/node/app +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 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/bin/dev b/bin/dev index 94d7a5db..0d61bda8 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::app-login"; startServer(serverPort, initialClient); \ No newline at end of file diff --git a/bin/prod b/bin/prod index 94d7a5db..9f01282b 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.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 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": {