-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.dev
More file actions
36 lines (26 loc) · 888 Bytes
/
Dockerfile.dev
File metadata and controls
36 lines (26 loc) · 888 Bytes
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
30
31
32
33
34
35
36
# syntax=docker.io/docker/dockerfile:1
FROM node:22-alpine
# Check https://github.com/nodejs/docker-node/tree/main#nodealpine to understand why libc6-compat might be needed
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Copy the Prisma schema first
COPY prisma ./prisma
# Install dependencies
COPY package.json package-lock.json* yarn.lock* pnpm-lock.yaml* .npmrc* ./
RUN \
if [ -f yarn.lock ]; then yarn; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i; \
else echo "Lockfile not found." && exit 1; \
fi
# Install sharp for image optimization even in dev
RUN npm install --no-package-lock sharp
# Copy rest of the source code
COPY . .
# Set development environment
ENV NODE_ENV=development
ENV NEXT_TELEMETRY_DISABLED=1
# Expose port
EXPOSE 3000
# Start development server
CMD ["npm", "run", "dev"]