Skip to content

Commit

Permalink
fix: docker build image for untp playground
Browse files Browse the repository at this point in the history
Signed-off-by: Nam Hoang <[email protected]>
  • Loading branch information
namhoang1604 committed Dec 5, 2024
1 parent 7cf4464 commit 7c2fbb9
Show file tree
Hide file tree
Showing 3 changed files with 720 additions and 4,025 deletions.
14 changes: 2 additions & 12 deletions packages/untp-playground/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ ENV NEXT_PUBLIC_ASSET_PREFIX=/

# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi
RUN yarn install


# Rebuild the source code only when needed
Expand All @@ -36,12 +31,7 @@ ENV NEXT_PUBLIC_BASE_PATH=${NEXT_PUBLIC_BASE_PATH}
ENV NEXT_PUBLIC_ASSET_PREFIX=${NEXT_PUBLIC_ASSET_PREFIX}
ENV NEXT_PUBLIC_IMAGE_PATH=${NEXT_PUBLIC_IMAGE_PATH}

RUN \
if [ -f yarn.lock ]; then yarn run build; \
elif [ -f package-lock.json ]; then npm run build; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
else echo "Lockfile not found." && exit 1; \
fi
RUN yarn run build

# Production image, copy all the files and run next
FROM base AS runner
Expand Down
Loading

0 comments on commit 7c2fbb9

Please sign in to comment.