Self-contained Dockerized build for end users. Run via docker compose; see README.md for setup. Source-only, no sample data or build artifacts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
27 lines
838 B
Docker
27 lines
838 B
Docker
# Mr. Drew's Assignment Creator — production image.
|
|
# Build context is the repository root: docker build -f docker/Dockerfile .
|
|
# (docker-compose.yml in this folder does that for you.)
|
|
|
|
FROM node:20-alpine AS deps
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
|
|
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM node:20-alpine AS run
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3000
|
|
# Next.js "standalone" output: a self-contained server, no node_modules needed.
|
|
COPY --from=build /app/.next/standalone ./
|
|
COPY --from=build /app/.next/static ./.next/static
|
|
# The single-file database lives here — mounted as a volume by compose.
|
|
RUN mkdir -p /app/data && chown -R node:node /app
|
|
USER node
|
|
EXPOSE 3000
|
|
CMD ["node", "server.js"]
|