Skip to content

DO NOT MERGE: Add configurable course base domain and container support - #1095

Open
lgriffin wants to merge 1 commit into
tutors-sdk:developmentfrom
lgriffin:feat/configurable-course-url
Open

DO NOT MERGE: Add configurable course base domain and container support#1095
lgriffin wants to merge 1 commit into
tutors-sdk:developmentfrom
lgriffin:feat/configurable-course-url

Conversation

@lgriffin

Copy link
Copy Markdown
Contributor

DO NOT MERGE — Testing/Experimental

This PR is a proof of concept for deploying Tutors on Kubernetes/OpenShift. Not ready for production.

Summary

  • Replace hardcoded .netlify.app domain in course URL resolution with a configurable PUBLIC_COURSE_BASE_DOMAIN environment variable (defaults to .netlify.app for backward compatibility)
  • Add Dockerfile for building the reader as a Node.js container (multi-stage build using adapter-node)
  • Add Dockerfile.course as a sample nginx container for serving static course content with CORS headers
  • Add svelte.config.node.js so container builds use adapter-node while the repo default stays adapter-auto (Netlify unaffected)

Architecture

Approach 1: Reader deployed centrally on OpenShift, courses served from configurable locations (other containers, student machines, or existing Netlify sites).

Student machine                    OpenShift cluster
┌─────────────────┐               ┌──────────────────┐
│ Course container │◄──fetch──────│  Reader (SvelteKit)│
│ (nginx, :8080)  │   tutors.json │  (node, :3000)    │
└─────────────────┘               └──────────────────┘

Files changed

File Change
src/lib/services/course/config.ts New — centralizes PUBLIC_COURSE_BASE_DOMAIN with fallback
src/lib/services/course/services/lo-tree.ts determineCourseUrl() accepts optional baseDomain param
src/lib/services/community/services/catalogue.ts Uses configurable domain for catalogue pruning
.env.example Documents PUBLIC_COURSE_BASE_DOMAIN
Dockerfile Multi-stage reader container
Dockerfile.course Sample course container (nginx + CORS)
svelte.config.node.js adapter-node config for container builds
.dockerignore Build context exclusions
vitest.config.ts Alias for $env/static/public in tests
tests/mocks/env-static-public.ts Mock env vars for test runner

Test plan

  • All existing determineCourseUrl() tests pass (backward compatible)
  • New configurable domain tests pass (7/7)
  • npm run build succeeds
  • Docker build and run the reader container
  • Docker build and run a course container
  • Verify reader fetches course from custom domain

🤖 Generated with Claude Code

Replace hardcoded .netlify.app domain with a configurable
PUBLIC_COURSE_BASE_DOMAIN env var, enabling courses to be served
from any hosting provider (OpenShift, localhost, custom domains).
Add Dockerfiles for both the reader and course containers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

@lgriffin is attempting to deploy a commit to the Jordan Harrison Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant