-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.frontend
More file actions
47 lines (30 loc) · 803 Bytes
/
Dockerfile.frontend
File metadata and controls
47 lines (30 loc) · 803 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
37
38
39
40
41
42
43
44
45
46
47
#######################################
# DEVELOPMENT STAGE
#######################################
FROM node:22-alpine AS development
WORKDIR /app
COPY frontend/package*.json ./
RUN npm ci
COPY frontend .
EXPOSE 3000
CMD ["npm", "run", "dev"]
#######################################
# BUILDER STAGE
#######################################
FROM node:22-alpine AS builder
WORKDIR /app
COPY frontend/package*.json ./
RUN npm ci
COPY frontend .
# Build Next.js
RUN npm run build
#######################################
# PRODUCTION STAGE
#######################################
FROM node:22-alpine AS production
WORKDIR /app
# Copy entire app (including .next, public, node_modules, package.json)
COPY --from=builder /app ./
ENV NODE_ENV=production
EXPOSE 3000
CMD ["npm", "run", "start"]