fix: add not-found.tsx, convert to next.config.mjs, add NODE_ENV=development to Dockerfile
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
|
ARG CACHE_BUST=1
|
||||||
|
ENV NODE_ENV=development
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json* ./
|
COPY package.json package-lock.json* ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
@@ -11,7 +13,7 @@ RUN apk add --no-cache dumb-init
|
|||||||
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
|
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
|
||||||
COPY --from=builder /app/.next/standalone ./
|
COPY --from=builder /app/.next/standalone ./
|
||||||
COPY --from=builder /app/.next/static ./.next/static
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
ENV NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3002
|
ENV NODE_ENV=production HOSTNAME=0.0.0.0
|
||||||
EXPOSE 3002
|
EXPOSE 3002
|
||||||
USER nextjs
|
USER nextjs
|
||||||
ENTRYPOINT ["dumb-init", "--"]
|
ENTRYPOINT ["dumb-init", "--"]
|
||||||
|
|||||||
5
next.config.mjs
Normal file
5
next.config.mjs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
/** @type {import('next').NextConfig} */
|
||||||
|
const nextConfig = {
|
||||||
|
output: 'standalone',
|
||||||
|
};
|
||||||
|
export default nextConfig;
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
import type { NextConfig } from 'next';
|
|
||||||
const nextConfig: NextConfig = { output: 'standalone' };
|
|
||||||
export default nextConfig;
|
|
||||||
10
src/app/not-found.tsx
Normal file
10
src/app/not-found.tsx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export default function NotFound() {
|
||||||
|
return (
|
||||||
|
<html lang="en">
|
||||||
|
<body>
|
||||||
|
<h1>404 - Page Not Found</h1>
|
||||||
|
<p>The page you are looking for does not exist.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user