-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (33 loc) · 1.05 KB
/
Dockerfile
File metadata and controls
48 lines (33 loc) · 1.05 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM node:alpine AS build
# Installiere pnpm
RUN npm install -g pnpm
WORKDIR /app
# Kopiere package.json und pnpm-lock.yaml für besseres Caching
COPY src/package.json src/pnpm-lock.yaml ./
# Installiere Dependencies mit pnpm
RUN pnpm install
# Kopiere den gesamten Quellcode
COPY src/ ./
# Build die Anwendung
RUN pnpm run build
# Stage 2: Production
FROM node:alpine AS production
# Installiere pnpm
RUN npm install -g pnpm
WORKDIR /app
# Kopiere package.json und pnpm-lock.yaml für Production Dependencies
COPY --from=build /app/package.json ./
COPY --from=build /app/pnpm-lock.yaml ./
# Installiere nur Production Dependencies
RUN pnpm install --prod --frozen-lockfile
# Kopiere Build-Artefakte und notwendige Dateien
COPY --from=build /app/.next ./.next
COPY --from=build /app/public ./public
COPY --from=build /app/pages ./pages
COPY --from=build /app/components ./components
COPY --from=build /app/next.config.js ./
COPY --from=build /app/theme.config.tsx ./
COPY --from=build /app/styles ./styles
EXPOSE 3000
ENV NODE_ENV=production
CMD ["pnpm", "start"]