Personal e-portfolio with an admin panel. Next.js + SQLite (via Prisma), deployed with Docker.
npm install
# First run only — create the SQLite DB and tables
npx prisma migrate dev
# Create admin user
ADMIN_EMAIL=you@example.com ADMIN_PASSWORD=yourpassword node scripts/create-admin.mjs
npm run dev # → http://localhost:3000.env (gitignored, already present locally):
DATABASE_URL="file:./data/hjemmeside-dev.db"
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=<secret>Prisma Studio: npx prisma studio → http://localhost:5555
Schema: prisma/schema.prisma
Builds the production image with source bind-mounted, plus Prisma Studio as a sidecar.
docker compose -f docker-compose.dev.yml up --buildDeployed via GitHub Actions (.github/workflows/deploy.yml) — trigger manually from the Actions tab.
The workflow SSHs into the server and runs:
git reset --hard origin/main → docker compose up --build -d
prisma migrate deploy runs automatically inside the container before the app starts (see CMD in Dockerfile), so no separate migration step is needed after deploy.
Before the first deploy, create .env on the server:
DATABASE_URL="file:/app/data/hjemmeside.db"
NEXTAUTH_URL=https://yourdomain.com
NEXTAUTH_SECRET=<secret> # openssl rand -base64 32After the first deploy, create the admin user:
docker compose exec -e ADMIN_EMAIL=you@example.com -e ADMIN_PASSWORD=yourpassword hjemmeside node scripts/create-admin.mjsSQLite data persists in a named Docker volume (sqlite_data). See docker-compose.yml and Dockerfile.
Image size note: the Docker image intentionally copies the full
node_modules(not just the Next.js standalone subset). This is required because the Prisma 6.x CLI has a deep transitive dependency tree absent from the standalone output, and cherry-picking packages breaks on every Prisma upgrade. The image is larger (~400 MB extra) but maintenance-free.
npx prisma migrate dev --name describe_change