diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8006912 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +# syntax=docker/dockerfile:1 + +# ---- deps: install dependencies only (cached layer) ---- +FROM node:20-alpine AS deps +WORKDIR /app +COPY package.json package-lock.json* ./ +RUN npm ci + +# ---- builder: build the Next.js app ---- +FROM node:20-alpine AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +ENV NEXT_TELEMETRY_DISABLED=1 +RUN npm run build + +# ---- runner: minimal production image ---- +FROM node:20-alpine AS runner +WORKDIR /app + +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 +ENV PORT=3000 +ENV HOSTNAME=0.0.0.0 + +RUN addgroup --system --gid 1001 nodejs \ + && adduser --system --uid 1001 nextjs + +# Standalone output — requires `output: "standalone"` in next.config.ts (see note below) +COPY --from=builder --chown=nextjs:nodejs /app/public ./public +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static + +USER nextjs + +EXPOSE 3000 + +CMD ["node", "server.js"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..62f9cd2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,36 @@ +services: + web: + build: + context: . + dockerfile: Dockerfile + image: rotary-club-vellore:latest + container_name: rotary-club-vellore + restart: unless-stopped + ports: + - "3000:3000" + environment: + - NODE_ENV=production + # healthcheck: hits the site root to confirm the container is actually serving + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 10s + + # Optional: run with hot-reload for local development instead of the prod image. + # Usage: docker compose --profile dev up web-dev + web-dev: + profiles: ["dev"] + image: node:20-alpine + working_dir: /app + command: sh -c "npm ci && npm run dev" + ports: + - "3000:3000" + environment: + - NODE_ENV=development + - NEXT_TELEMETRY_DISABLED=1 + volumes: + - .:/app + - /app/node_modules + - /app/.next diff --git a/dockerignore b/dockerignore new file mode 100644 index 0000000..cc36fdb --- /dev/null +++ b/dockerignore @@ -0,0 +1,17 @@ +node_modules +.next +out +.git +.gitignore +.env +.env.local +.env.*.local +npm-debug.log* +Dockerfile +docker-compose.yml +.dockerignore +README.md +SETUP.md +*.md +.vscode +.DS_Store diff --git a/next.config.ts b/next.config.ts index 66e1566..30d7f8b 100644 --- a/next.config.ts +++ b/next.config.ts @@ -3,6 +3,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ reactCompiler: true, + output: "standalone", }; export default nextConfig; diff --git a/src/components/Hero.tsx b/src/components/Hero.tsx index 25f2fdf..f1e8ad1 100644 --- a/src/components/Hero.tsx +++ b/src/components/Hero.tsx @@ -15,9 +15,18 @@ export default function Hero() { className="pointer-events-none absolute -bottom-32 -left-20 h-72 w-72 text-rotary-gold/[0.06]" /> -
+
{/* Brand row — replaces the old header's logo now that it's gone */}
+ + + Rotary Club of Vellore + + + District 3231 · Est. 1948 + + +
- - - - Rotary Club of Vellore - - - District 3231 · Est. 1948 - -
@@ -43,7 +43,7 @@ export default function Hero() {
{/* Advisor + President thumbnails */}
-
+
Rtn. Dr. T. Jacob John, Club Advisor
-
+