-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (22 loc) · 594 Bytes
/
Dockerfile
File metadata and controls
29 lines (22 loc) · 594 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
### Base Image & Dependencies Stage
FROM node:18-alpine AS deps
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm install
# Copy source and build
COPY . .
RUN npm run build
# Production image
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
# Copy build artifacts
COPY --from=deps /app/.next ./.next
COPY --from=deps /app/package*.json ./
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/public ./public
# Copy .env file for runtime environment variables (remove from .dockerignore)
COPY .env .env
EXPOSE 3000
CMD ["npm", "start"]