-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc351bd
commit 3db8745
Showing
2 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM node:20-alpine | ||
|
||
WORKDIR /app | ||
|
||
# Install dependencies based on the preferred package manager | ||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ | ||
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; \ | ||
# Allow install without lockfile, so example works even without Node.js installed locally | ||
else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && yarn install; \ | ||
fi | ||
|
||
COPY src ./src | ||
COPY public ./public | ||
COPY next.config.js . | ||
COPY tsconfig.json . | ||
|
||
# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry | ||
# Uncomment the following line to disable telemetry at run time | ||
# ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
# Note: Don't expose ports here, Compose will handle that for us | ||
|
||
# Start Next.js in development mode based on the preferred package manager | ||
CMD \ | ||
if [ -f yarn.lock ]; then yarn dev; \ | ||
elif [ -f package-lock.json ]; then npm run dev; \ | ||
elif [ -f pnpm-lock.yaml ]; then pnpm dev; \ | ||
else npm run dev; \ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters