Skip to content

Commit 182f4bd

Browse files
Setup stanalone export to reduce docker image size (#20)
1 parent 2a9114a commit 182f4bd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ FROM node:18-alpine AS builder
22

33
# ENV NODE_ENV=production
44

5-
WORKDIR /build
5+
WORKDIR /app
66
COPY . .
7+
78
RUN npm install && npm update @orchestrator-ui/orchestrator-ui-components && npm update @orchestrator-ui/eslint-config-custom && npm update @orchestrator-ui/jest-config && npm update @orchestrator-ui/tsconfig
89
RUN npm run build
910

@@ -12,11 +13,12 @@ FROM node:18-alpine AS runner
1213

1314
# ENV NODE_ENV=production
1415

15-
WORKDIR /app
16-
COPY --chown=node --from=builder /build .
16+
COPY --from=builder /app/.next/standalone /app
17+
COPY --from=builder /app/.next/static /app/.next/static
1718

19+
WORKDIR /app
1820
USER node
1921
EXPOSE 3000
20-
CMD npm start
22+
CMD ["node", "server.js"]
2123

2224

next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
reactStrictMode: false,
3+
output: 'standalone',
34
i18n: {
45
// These are all the locales you want to support in
56
// your application

0 commit comments

Comments
 (0)