add docker

This commit is contained in:
2025-04-23 20:52:01 +07:00
parent ef52d632bd
commit 4af35a14c6
3 changed files with 52 additions and 0 deletions

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
FROM node:22-alpine AS base
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package*.json package-lock*.json ./
RUN npm ci --omit=dev
RUN npm install @tailwindcss/oxide-linux-x64-musl
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
FROM base AS production
WORKDIR /app
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
EXPOSE 3000
CMD ["node", "server.js"]

7
docker-compose.yml Normal file
View File

@@ -0,0 +1,7 @@
services:
sranalysis:
build:
context: .
dockerfile: Dockerfile
container_name: sranalysis
restart: unless-stopped

View File

@@ -5,6 +5,25 @@ import type { NextConfig } from "next";
const withNextIntl = createNextIntlPlugin()
const nextConfig: NextConfig = {
reactStrictMode: false,
output: 'standalone',
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'localhost',
pathname: '**',
},
{
protocol: 'http',
hostname: 'localhost',
pathname: '**',
}
],
},
eslint: {
ignoreDuringBuilds: true,
},
async rewrites() {
return [
{