From 4b7b96e5b3ae7331804ecdbcbed9dacc36e24929 Mon Sep 17 00:00:00 2001 From: Shawn O'Connor Date: Fri, 20 Dec 2024 16:45:09 -0600 Subject: [PATCH] Merge main repo into fork (#32) --- Dockerfile | 60 +++++++++------------- package-lock.json | 127 ++++++++++++++++++++++++---------------------- package.json | 2 +- start.sh | 5 ++ 4 files changed, 94 insertions(+), 100 deletions(-) create mode 100644 start.sh diff --git a/Dockerfile b/Dockerfile index 3b80b98..815c179 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,44 +1,30 @@ -# docker build -t gen3ff . -# docker run -p 3000:3000 -it gen3ff -# for Macbook silicon M1/m2 uncomment the following lines and comment quay.io/cdis/ubuntu:20.04: -#FROM arm64v8/ubuntu:20.04 as build - -FROM quay.io/cdis/ubuntu:20.04 AS build - -ARG NODE_VERSION=20 - -ARG BASE_PATH -ARG NEXT_PUBLIC_PORTAL_BASENAME -ENV NPM_CONFIG_PREFIX=/home/node/.npm-global -ENV PATH=$PATH:/home/node/.npm-global/bin +# Build stage +FROM node:20-slim AS builder WORKDIR /gen3 -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - libssl1.1 \ - libgnutls30 \ - ca-certificates \ - curl \ - git \ - gnupg \ - && mkdir -p /etc/apt/keyrings \ - && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ - && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ - && apt-get update \ - && apt-get install -y nodejs \ - && apt-get clean \ - && npm install -g npm@10.5.2 - -RUN addgroup --system --gid 1001 nextjs && adduser --system --uid 1001 nextjs COPY ./package.json ./package-lock.json ./next.config.js ./tsconfig.json ./.env.development ./tailwind.config.js ./postcss.config.js ./ +RUN npm ci COPY ./src ./src COPY ./public ./public COPY ./config ./config -RUN npm ci -RUN npm install \ - "@swc/core" \ - "@napi-rs/magic-string" -RUN npm run build -ENV PORT=80 -CMD ["npm", "run", "start"] +COPY ./start.sh ./ +RUN npm install @swc/core @napi-rs/magic-string && \ + npm run build + +# Production stage +FROM node:20-slim AS runner + +WORKDIR /gen3 +ENV PORT=3000 + +RUN addgroup --system --gid 1001 nextjs && \ + adduser --system --uid 1001 nextjs + +COPY --from=builder /gen3/config ./config +COPY --from=builder /gen3/public ./public +COPY --from=builder /gen3/.next/static ./.next/static + +USER nextjs +ENV PORT=3000 +CMD bash ./start.sh diff --git a/package-lock.json b/package-lock.json index 9e7fce1..db74d6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@mdx-js/loader": "^3.0.0", "@mdx-js/react": "^3.0.0", "@next/mdx": "^14.2.15", - "cookies-next": "^4.1.1", + "cookies-next": "^4.3.0", "idb": "^8.0.0", "jsonpath-plus": "^10.2.0", "react": "^18.2.0", @@ -1730,9 +1730,9 @@ "license": "OFL-1.1" }, "node_modules/@gen3/core": { - "version": "0.10.67", - "resolved": "https://registry.npmjs.org/@gen3/core/-/core-0.10.67.tgz", - "integrity": "sha512-gWSiC5Ddm5GG/CR2dML0mjaRE1H8cMMLuCp2K2X6oEVaZlgpOIJhX0UVc4qfS+kTOX98OTcI+ZAa998+93FvTw==", + "version": "0.10.68", + "resolved": "https://registry.npmjs.org/@gen3/core/-/core-0.10.68.tgz", + "integrity": "sha512-X2aadqtIiGGCjKo5x5sw2lJgmt66hzOe4RNJAnKZupBV6rNHwn4ogh4Dqq7UzzyTDROhx596MD2P2sTF8ipP+w==", "license": "Apache-2.0", "dependencies": { "@reduxjs/toolkit": "^2.2.8", @@ -1756,9 +1756,9 @@ } }, "node_modules/@gen3/frontend": { - "version": "0.10.67", - "resolved": "https://registry.npmjs.org/@gen3/frontend/-/frontend-0.10.67.tgz", - "integrity": "sha512-/mY2b6lOc2oStftXQu0h7eUeMkN9Rd4CNXEUd1Af9YHkuB/+8DL/gELpUyEi5r53nC2V6bohfDFhrFa4XEAL4Q==", + "version": "0.10.68", + "resolved": "https://registry.npmjs.org/@gen3/frontend/-/frontend-0.10.68.tgz", + "integrity": "sha512-5dvvHipmTp6k4FILpAlWmGCoD+NZ32XR8jlFQCfbG4rH+CRTPugM2HlxrGzHH4XM/dtr97wfaDgZnALBF3qlEg==", "license": "Apache-2.0", "dependencies": { "@graphiql/react": "^0.23.1", @@ -1830,7 +1830,7 @@ "npm": ">=10.2.3" }, "peerDependencies": { - "@gen3/core": "^0.10.67", + "@gen3/core": "^0.10.68", "react": "^18.2.0", "react-dom": "^18.2.0", "tailwindcss": "^3.4.16" @@ -1905,9 +1905,9 @@ } }, "node_modules/@gen3/toolsff": { - "version": "0.10.67", - "resolved": "https://registry.npmjs.org/@gen3/toolsff/-/toolsff-0.10.67.tgz", - "integrity": "sha512-tJmS5fkSChOayIkmIZQNLZ92UBGX4PBJR8Vvngkr9UyeP61akjNrROoJD6yt90iPyGpH7J+BQhB3L/tQVaKM2Q==", + "version": "0.10.68", + "resolved": "https://registry.npmjs.org/@gen3/toolsff/-/toolsff-0.10.68.tgz", + "integrity": "sha512-t+1+Il6wZGifC1KDqeUgVEgInJg27yRiKkdQwrl/PUO74dSHfvo/9SbLmOZGHx7x40oCUDTW7lYix1fRfXrI/g==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -3173,9 +3173,9 @@ } }, "node_modules/@kbox-labs/react-echarts": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@kbox-labs/react-echarts/-/react-echarts-1.4.1.tgz", - "integrity": "sha512-F18gl7OXcG0+6LavlX0m0Ru5Ga0/1E7zVU764XrhY3cUTkevomOrt7+v/amaL4NK00xLh4AQrzDv/uJkiV7LqA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@kbox-labs/react-echarts/-/react-echarts-1.4.2.tgz", + "integrity": "sha512-ocXdvu5Fx7c7mHSYNlxxv3eheajfEXHztYChTlmhUt3asdPn30SRlYVtp8dGonid72WnB8uw0k2Y1V+whHQhLw==", "license": "MIT", "peerDependencies": { "echarts": "^5", @@ -6815,9 +6815,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "18.3.17", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.17.tgz", - "integrity": "sha512-opAQ5no6LqJNo9TqnxBKsgnkIYHozW9KSTlFVoSUJYh1Fl/sswkEoqIugRSm7tbh6pABtYjGAjW+GOS23j8qbw==", + "version": "18.3.18", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.18.tgz", + "integrity": "sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==", "license": "MIT", "dependencies": { "@types/prop-types": "*", @@ -7540,14 +7540,14 @@ "peer": true }, "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" }, "engines": { "node": ">= 0.4" @@ -9483,15 +9483,15 @@ "license": "BSD-2-Clause" }, "node_modules/data-view-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", - "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -9501,21 +9501,21 @@ } }, "node_modules/data-view-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", - "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/inspect-js" } }, "node_modules/data-view-byte-offset": { @@ -10071,9 +10071,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", - "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz", + "integrity": "sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==", "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", @@ -10188,27 +10188,28 @@ } }, "node_modules/es-iterator-helpers": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.0.tgz", - "integrity": "sha512-tpxqxncxnpw3c93u8n3VOzACmRFoVmWJqbWXvX/JfKbkhBw1oslgPrUfeSt2psuqyEJFD6N/9lg5i7bsKpoq+Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", - "es-abstract": "^1.23.3", + "es-abstract": "^1.23.6", "es-errors": "^1.3.0", "es-set-tostringtag": "^2.0.3", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", + "get-intrinsic": "^1.2.6", "globalthis": "^1.0.4", - "gopd": "^1.0.1", + "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.7", - "iterator.prototype": "^1.1.3", - "safe-array-concat": "^1.1.2" + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" }, "engines": { "node": ">= 0.4" @@ -11923,13 +11924,14 @@ } }, "node_modules/function.prototype.name": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.7.tgz", - "integrity": "sha512-2g4x+HqTJKM9zcJqBSpjoRmdcPFtJM60J3xJisTQSXBWka5XqyBN/2tNUgma1mztTXyDuUsEtYe5qcs7xYzYQA==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", "functions-have-names": "^1.2.3", "hasown": "^2.0.2", @@ -28255,24 +28257,25 @@ } }, "node_modules/string.prototype.matchall": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", - "integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==", + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", + "es-abstract": "^1.23.6", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.7", - "regexp.prototype.flags": "^1.5.2", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", "set-function-name": "^2.0.2", - "side-channel": "^1.0.6" + "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" diff --git a/package.json b/package.json index eef3839..daf16fe 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@mdx-js/loader": "^3.0.0", "@mdx-js/react": "^3.0.0", "@next/mdx": "^14.2.15", - "cookies-next": "^4.1.1", + "cookies-next": "^4.3.0", "idb": "^8.0.0", "jsonpath-plus": "^10.2.0", "react": "^18.2.0", diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..5cf0f39 --- /dev/null +++ b/start.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e +echo "starting server" +npm run start