-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
29 lines (23 loc) · 1.14 KB
/
Dockerfile.dev
File metadata and controls
29 lines (23 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine
WORKDIR /app
ENV ROOT_FOLDER=website/
# Install dependencies based on the preferred package manager
COPY ${ROOT_FOLDER}package.json ${ROOT_FOLDER}yarn.lock* ${ROOT_FOLDER}pnpm-lock.yaml* ${ROOT_FOLDER}package-lock.json* ${ROOT_FOLDER}.npmrc* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i; \
elif [ -f package-lock.json ]; then npm ci; \
# 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
# 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
# Start Next.js in development mode based on the preferred package manager
CMD \
if [ -f yarn.lock ]; then yarn dev; \
elif [ -f pnpm-lock.yaml ]; then pnpm dev; \
elif [ -f package-lock.json ]; then npm run dev; \
else npm run dev; \
fi