Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ RUN apk add --no-cache openssl

WORKDIR /app

# Copy package files
# Copy package files and scripts (needed for postinstall)
COPY package*.json ./
COPY prisma ./prisma/
COPY scripts ./scripts/

# Install dependencies
RUN npm ci
Expand Down Expand Up @@ -42,11 +43,11 @@ COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/prisma.config.ts ./
COPY --from=builder /app/server.ts ./
COPY --from=builder /app/src ./src
COPY --from=builder /app/tsconfig.json ./
COPY --from=builder /app/next.config.mjs ./
COPY --from=builder /app/tailwind.config.ts ./
COPY --from=builder /app/postcss.config.mjs ./

# Create data directory for SQLite
Expand All @@ -58,7 +59,7 @@ USER nextjs
EXPOSE 3000

ENV PORT=3000
ENV DATABASE_URL="file:./data/quiz.db"
ENV DATABASE_URL="file:./prisma/data/quiz.db"

# Start the server
CMD ["sh", "-c", "npx prisma migrate deploy && npm run start"]
1 change: 0 additions & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "slate",
"cssVariables": true,
Expand Down
21 changes: 13 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
services:
quiz0r:
image: quiz0r:latest
container_name: quiz0r

build:
context: .
target: runner

image: quiz0r:latest

restart: unless-stopped

ports:
- "3000:3000"
- "18081:3000"

environment:
NODE_ENV: production
DATABASE_URL: file:./prisma/data/quiz.db
TZ: Europe/Berlin

volumes:
# Persist SQLite database
- quiz-data:/app/prisma/data
# Persist uploaded images (if used)
- quiz-uploads:/app/public/uploads
environment:
- NODE_ENV=production
- DATABASE_URL=file:./data/quiz.db
restart: unless-stopped

volumes:
quiz-data:
Expand Down
5 changes: 1 addition & 4 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
// Externalize @ngrok/ngrok to avoid webpack bundling native modules
serverComponentsExternalPackages: ["@ngrok/ngrok"],
},
serverExternalPackages: ["@ngrok/ngrok"],
images: {
remotePatterns: [
{
Expand Down
Loading