diff --git a/.dockerignore b/.dockerignore index 809de24..6b7aa8c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,6 @@ node_modules/ -# .next/ +.next/ out/ dist/ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d8cb8b6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:20-alpine AS builder +WORKDIR /app + +# Install pnpm +RUN corepack enable + +# Copy and Install dependencies +COPY package.json pnpm-lock.yaml ./ +RUN pnpm install --frozen-lockfile + +# Copy source and build the application +COPY . . +RUN pnpm build + +# --- runtime --- +FROM node:20-alpine + +RUN addgroup -S appgroup && adduser -S -G appgroup -u 1001 appuser +WORKDIR /app + +COPY --from=builder --chown=appuser:appgroup /app/.next/standalone ./ +COPY --from=builder --chown=appuser:appgroup /app/.next/static .next/static +COPY --from=builder --chown=appuser:appgroup /app/public public + +EXPOSE 3000 +USER appuser +CMD ["node", "server.js"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..67047db --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +services: + frontend: + build: + context: . + dockerfile: Dockerfile + ports: + - "3000:3000" + volumes: + - .:/app + - /app/node_modules + environment: + - WATCHPACK_POLLING=true diff --git a/next.config.ts b/next.config.ts index 94fba47..720431d 100644 --- a/next.config.ts +++ b/next.config.ts @@ -5,6 +5,10 @@ const nextConfig: NextConfig = { compiler: { styledComponents: true, }, + eslint: { + ignoreDuringBuilds: true, + }, + output: 'standalone', }; export default nextConfig;