Add Docker deployment for Netcup/Traefik, replace Vercel hosting
- Dockerfile with multi-stage build (deps → build → standalone runner) - docker-compose.yml with Traefik labels for draw.jeffemmett.com - Enable Next.js standalone output mode for Docker Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
eed020d198
commit
769597ca16
|
|
@ -0,0 +1,4 @@
|
||||||
|
node_modules
|
||||||
|
.next
|
||||||
|
.git
|
||||||
|
.env*
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
FROM node:18-alpine AS deps
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
FROM node:18-alpine AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
|
COPY . .
|
||||||
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:18-alpine AS runner
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
|
||||||
|
COPY --from=builder /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
|
||||||
|
ENV PORT=3000
|
||||||
|
CMD ["node", "server.js"]
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
services:
|
||||||
|
draw-fast:
|
||||||
|
build: .
|
||||||
|
container_name: draw-fast
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
- FAL_KEY=${FAL_KEY}
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.draw-fast.rule=Host(`draw.jeffemmett.com`)"
|
||||||
|
- "traefik.http.routers.draw-fast.entrypoints=web"
|
||||||
|
- "traefik.http.services.draw-fast.loadbalancer.server.port=3000"
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik:
|
||||||
|
external: true
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {};
|
const nextConfig = {
|
||||||
|
output: 'standalone',
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = nextConfig;
|
module.exports = nextConfig;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue