Update deps, fix Docker build errors

This commit is contained in:
Darren Clarke 2024-05-14 09:40:58 +02:00
parent 162390008b
commit c62bfd2a4c
31 changed files with 832 additions and 1227 deletions

View file

@ -0,0 +1,50 @@
FROM node:20-bookworm AS base
FROM base AS builder
ARG APP_DIR=/opt/bridge-frontend
RUN mkdir -p ${APP_DIR}/
RUN npm i -g turbo
WORKDIR ${APP_DIR}
COPY . .
RUN turbo prune --scope=bridge-frontend --docker
FROM base AS installer
ARG APP_DIR=/opt/bridge-frontend
WORKDIR ${APP_DIR}
COPY --from=builder ${APP_DIR}/.gitignore .gitignore
COPY --from=builder ${APP_DIR}/out/json/ .
COPY --from=builder ${APP_DIR}/out/package-lock.json ./package-lock.json
RUN npm ci
COPY --from=builder ${APP_DIR}/out/full/ .
RUN npm i -g turbo
RUN turbo run build --filter=bridge-frontend
FROM base AS runner
ARG APP_DIR=/opt/bridge-frontend
WORKDIR ${APP_DIR}/
ARG BUILD_DATE
ARG VERSION
LABEL maintainer="Darren Clarke <darren@redaranj.com>"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.version=$VERSION
ENV APP_DIR ${APP_DIR}
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y --no-install-recommends \
dumb-init
RUN mkdir -p ${APP_DIR}
RUN chown -R node ${APP_DIR}/
USER node
WORKDIR ${APP_DIR}
COPY --from=installer ${APP_DIR}/node_modules/ ./node_modules/
COPY --from=installer ${APP_DIR}/apps/bridge-frontend/ ./apps/bridge-frontend/
COPY --from=installer ${APP_DIR}/package.json ./package.json
USER root
WORKDIR ${APP_DIR}/apps/bridge-frontend/
RUN chmod +x docker-entrypoint.sh
USER node
EXPOSE 3000
ENV PORT 3000
ENV NODE_ENV production
ENTRYPOINT ["/opt/link/apps/bridge-frontend/docker-entrypoint.sh"]

View file

@ -0,0 +1,5 @@
#!/bin/bash
set -e
echo "starting bridge-frontend"
exec dumb-init npm run start

View file

@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@auth/kysely-adapter": "^1.0.0",
"@auth/kysely-adapter": "^1.1.0",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
@ -17,9 +17,11 @@
"@mui/lab": "^5.0.0-alpha.170",
"@mui/material": "^5",
"@mui/material-nextjs": "^5.15.11",
"@mui/x-data-grid-pro": "^7.3.2",
"@mui/x-date-pickers-pro": "^7.3.2",
"@mui/x-data-grid-pro": "^7.4.0",
"@mui/x-date-pickers-pro": "^7.4.0",
"@mui/x-license": "^7.2.0",
"bridge-common": "*",
"bridge-ui": "*",
"date-fns": "^3.6.0",
"dotenv": "^16.4.5",
"graphile-worker": "^0.16.6",
@ -33,13 +35,12 @@
"react-cookie": "^7.1.4",
"react-digit-input": "^2.1.0",
"react-dom": "18.3.1",
"react-qr-code": "^2.0.12",
"react-qr-code": "^2.0.13",
"react-timer-hook": "^3.0.7",
"sharp": "^0.33.3",
"tss-react": "^4.9.10",
"tsx": "^4.9.3",
"ui": "*",
"bridge-common": "*",
"bridge-ui": "*"
"tsx": "^4.10.2",
"ui": "*"
},
"devDependencies": {
"@types/node": "^20",

View file

@ -5,6 +5,7 @@
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
@ -12,14 +13,14 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"paths": {
"@/*": ["./*"]
},
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]