diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..f6d4eb53c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/node_modules +/.next diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..cb31a96c9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:24-alpine AS build +WORKDIR /app +COPY package-lock.json package.json ./ +RUN npm ci +COPY . . +RUN npm run build + +FROM node:24-alpine +ENV NODE_ENV=production +WORKDIR /app +COPY --from=build /app/.next/standalone ./ +COPY --from=build /app/.next/static ./.next/static +COPY --from=build /app/public ./public +EXPOSE 3000 +CMD ["node", "server.js"] diff --git a/next.config.mjs b/next.config.mjs index e42c04ccf..81049e1b5 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -5,6 +5,6 @@ const withBundleAnalyzer = bundleAnalyzer({ }) /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = {output: 'standalone',}; -export default withBundleAnalyzer(nextConfig); \ No newline at end of file +export default withBundleAnalyzer(nextConfig); diff --git a/package.json b/package.json index 9cf86f5ca..11116e958 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "scripts": { "dev": "next dev", "build": "next build", - "postbuild": "npm run db:migrate", "start": "next start", "lint": "next lint", "db:generate": "npx drizzle-kit generate",