diff --git a/spiffworkflow-frontend/.dockerignore b/spiffworkflow-frontend/.dockerignore new file mode 100644 index 00000000..07e6e472 --- /dev/null +++ b/spiffworkflow-frontend/.dockerignore @@ -0,0 +1 @@ +/node_modules diff --git a/spiffworkflow-frontend/Dockerfile b/spiffworkflow-frontend/Dockerfile index f06ade93..c777a268 100644 --- a/spiffworkflow-frontend/Dockerfile +++ b/spiffworkflow-frontend/Dockerfile @@ -12,6 +12,12 @@ FROM base AS setup COPY . /app/ +RUN cp /app/package.json /app/package.json.bak +ADD justservewebserver.package.json /app/package.json +RUN npm ci --ignore-scripts +RUN cp -r /app/node_modules /app/node_modules.justserve +RUN cp /app/package.json.bak /app/package.json + # npm ci because it respects the lock file. # --ignore-scripts because authors can do bad things in postinstall scripts. # https://cheatsheetseries.owasp.org/cheatsheets/NPM_Security_Cheat_Sheet.html @@ -31,5 +37,6 @@ ENV PORT0=7001 COPY --from=setup /app/build /app/build COPY --from=setup /app/bin /app/bin +COPY --from=setup /app/node_modules.justserve /app/node_modules ENTRYPOINT ["/app/bin/boot_server_in_docker"] diff --git a/spiffworkflow-frontend/justservewebserver.package.json b/spiffworkflow-frontend/justservewebserver.package.json new file mode 100644 index 00000000..d78004a3 --- /dev/null +++ b/spiffworkflow-frontend/justservewebserver.package.json @@ -0,0 +1,36 @@ +{ + "name": "spiffworkflow-frontend", + "version": "0.1.0", + "private": true, + "dependencies": { + "serve": "^14.0.0" + }, + "scripts": { + "start": "ESLINT_NO_DEV_ERRORS=true PORT=7001 craco start", + "build": "craco build", + "test": "react-scripts test --coverage", + "t": "npm test -- --watchAll=false", + "eject": "craco eject", + "format": "prettier --write src/**/*.[tj]s{,x}", + "lint": "./node_modules/.bin/eslint src", + "lint:fix": "./node_modules/.bin/eslint --fix src" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +}