From d0418895a5a9fa02035af528f4265666010f35c0 Mon Sep 17 00:00:00 2001 From: Dmytro Stanchiev Date: Sat, 16 Aug 2025 01:53:05 -0400 Subject: [PATCH] docker mvp --- .dockerignore | 17 +++++++++++++++++ Dockerfile | 29 ++++------------------------- docker-compose.yml | 12 ++++++------ next.config.ts | 3 ++- 4 files changed, 29 insertions(+), 32 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3205ed6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +node_modules +Dockerfile* +docker-compose* +.dockerignore +.git +.gitignore +README.md +FIXME.md +LICENSE +.vscode +Makefile +helm-charts +.env +.editorconfig +.idea +coverage* + diff --git a/Dockerfile b/Dockerfile index 6528e42..4079865 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,14 @@ -# ===================== -# Build Stage -# ===================== -FROM oven/bun:1.2.10-alpine AS builder +# syntax=docker.io/docker/dockerfile:1 -WORKDIR /app +FROM oven/bun:1.2.10 AS base -# Install dependencies -COPY package.json bun.lock ./ +COPY package.json bun.lock* ./ RUN bun install --frozen-lockfile -# Copy rest of app COPY . . -# Build Next.js app RUN bun run build -# ===================== -# Runtime Stage -# ===================== -FROM oven/bun:1.2.10-alpine - -WORKDIR /app - -# Copy only necessary files from builder -COPY --from=builder /app/package.json /app/package.json -COPY --from=builder /app/.next /app/.next -COPY --from=builder /app/public /app/public -COPY --from=builder /app/node_modules /app/node_modules - -# Expose port EXPOSE 3000 -# Run in production -CMD ["bun", "run", "start"] +CMD ["bun", "start"] diff --git a/docker-compose.yml b/docker-compose.yml index b148853..034f402 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,12 +5,12 @@ services: restart: unless-stopped # ports: # - "3000:3000" - environment: - NODE_ENV: production - OPENROUTER_API_KEY: ${OPENROUTER_API_KEY} - volumes: - - .:/app - - /app/node_modules + # environment: + # NODE_ENV: production + # OPENROUTER_API_KEY: ${OPENROUTER_API_KEY} + # volumes: + # - .:/app + # - /app/node_modules networks: - traefik - internal diff --git a/next.config.ts b/next.config.ts index b89e3a7..8e1047b 100644 --- a/next.config.ts +++ b/next.config.ts @@ -9,12 +9,13 @@ const withPWA = require("next-pwa")({ // const nextConfig: NextConfig = { // /* config options here */ +// reactStrictMode: true, // }; const nextConfig: NextConfig = withPWA({ /* config options here */ reactStrictMode: true, - // output: "export", + // output: "standalone", }); export default nextConfig;