fix depends
Some checks failed
Publish / docker (push) Failing after 32s

This commit is contained in:
Lee 2023-10-15 03:59:34 +01:00
parent 393ecf0c3f
commit 324f4ef0e2
5 changed files with 332 additions and 1893 deletions

@ -1,26 +1,19 @@
FROM fascinated/docker-images:node-pnpm-latest as main
# Install dependencies only when needed # Install dependencies only when needed
FROM node:20 AS deps FROM main AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
#RUN apk add libc6-compat #RUN apk add libc6-compat
WORKDIR /app WORKDIR /app
# Install dependencies based on the preferred package manager # Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ COPY pnpm-lock.yaml* ./
# Copy cached files # Install node modules
#COPY node_modules ./ RUN pnpm install --production
#RUN npm i
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi
# Rebuild the source code only when needed # Rebuild the source code only when needed
FROM node:20 AS builder FROM main AS builder
WORKDIR /app WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
@ -28,10 +21,10 @@ COPY . .
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
# Build the project # Build the project
RUN yarn build RUN pnpm build
# Production image, copy all the files and run next # Production image, copy all the files and run next
FROM node:20-alpine AS runner FROM main AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV production ENV NODE_ENV production
@ -49,7 +42,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./.next/static COPY --from=builder --chown=nextjs:nodejs /app/public ./.next/static
RUN npm i -g @beam-australia/react-env RUN pnpm i -g @beam-australia/react-env
RUN chown -R nextjs:nodejs /app RUN chown -R nextjs:nodejs /app

@ -13,7 +13,7 @@
"@beam-australia/react-env": "^3.1.1", "@beam-australia/react-env": "^3.1.1",
"@emotion/cache": "^11.11.0", "@emotion/cache": "^11.11.0",
"@emotion/server": "^11.11.0", "@emotion/server": "^11.11.0",
"@nextui-org/react": "^2.1.13", "@nextui-org/react": "1.0.0-beta.10",
"@typescript-eslint/eslint-plugin": "^6.7.5", "@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5", "@typescript-eslint/parser": "^6.7.5",
"axios": "^1.5.1", "axios": "^1.5.1",

2084
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff