Skip to content

Commit

Permalink
fix: nextjs build
Browse files Browse the repository at this point in the history
  • Loading branch information
m8vago committed Mar 12, 2024
1 parent 2e4b9c9 commit 7c3dafc
Show file tree
Hide file tree
Showing 7 changed files with 860 additions and 68 deletions.
16 changes: 8 additions & 8 deletions web/crux-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ COPY ./package.json ./package-lock.json ./.npm ./
RUN npm ci --arch=x64 --platform=linuxmusl --cache .npm --prefer-offline --no-fund

COPY . .
RUN npm run build && \
npm prune --production
RUN npm run build

# stage 2, run the app
FROM docker.io/library/node:20-alpine3.17 AS RUNNER
Expand All @@ -18,20 +17,21 @@ WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
ENV TZ UTC
RUN apk --update add tzdata
RUN apk --update add tzdata && \
mkdir .next && \
chown node:node .next

COPY --from=BUILDER --chown=node:node /app/public ./public
COPY --from=BUILDER /app/package.json ./package.json
COPY --from=BUILDER --chown=node:node /app/.next ./.next
COPY --from=BUILDER /app/node_modules ./node_modules
COPY --from=BUILDER --chown=node:node /app/.next/standalone ./
COPY --from=BUILDER --chown=node:node /app/.next/static ./.next/static

USER node

EXPOSE 3000
ENV HOSTNAME "0.0.0.0"
ENV PORT 3000
LABEL org.opencontainers.image.source="https://github.com/dyrector-io/dyrectorio/web/crux-ui"

HEALTHCHECK --interval=30s --timeout=5s \
CMD wget -nv -t1 --spider http://localhost:3000/ || exit 1

ENTRYPOINT [ "npm", "run", "start:prod"]
ENTRYPOINT [ "node", "server.js"]
1 change: 1 addition & 0 deletions web/crux-ui/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ module.exports = {
eslint: {
dirs: ['src', 'e2e'],
},
output: 'standalone',
}
Loading

0 comments on commit 7c3dafc

Please sign in to comment.