Mr. Drew's Assignment Creator — Docker share build

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>
This commit is contained in:
2026-06-21 19:58:36 -04:00
co-authored by Claude Opus 4.8
commit 5a51a0f112
33 changed files with 5413 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# 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"]
+18
View File
@@ -0,0 +1,18 @@
# Linux variant — run: docker compose -f docker-compose.linux.yml up -d
#
# Uses host networking, so the container sees Ollama / LM Studio on plain
# localhost exactly like a native install. No URL or firewall fiddling, and
# Ollama can stay bound to 127.0.0.1. (Host networking is a Linux-only
# Docker feature; macOS/Windows users should use docker-compose.yml.)
services:
assignment-creator:
build:
context: ..
dockerfile: docker/Dockerfile
network_mode: host # app serves on localhost:3000, talks to localhost:11434
volumes:
- assignment-data:/app/data
restart: unless-stopped
volumes:
assignment-data:
+32
View File
@@ -0,0 +1,32 @@
# Mr. Drew's Assignment Creator — run: docker compose up -d (from this folder)
#
# Works out of the box with Docker Desktop (macOS / Windows):
# the app reaches Ollama / LM Studio running on YOUR machine via
# host.docker.internal. On plain Linux, use docker-compose.linux.yml instead.
services:
assignment-creator:
build:
context: ..
dockerfile: docker/Dockerfile
ports:
- "3000:3000"
environment:
# Default provider URLs point at the Docker HOST (your machine).
# You can always change them later on the app's Settings page.
- OLLAMA_BASE_URL=http://host.docker.internal:11434
- LMSTUDIO_BASE_URL=http://host.docker.internal:1234
extra_hosts:
# Makes host.docker.internal resolve on Linux engines too.
- "host.docker.internal:host-gateway"
volumes:
# All assignments + settings live in one JSON file inside this volume.
- assignment-data:/app/data
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/api/settings"]
interval: 30s
timeout: 5s
retries: 3
volumes:
assignment-data: