From 859602a03e2ed913343a4d2d290bf6e922a0ac77 Mon Sep 17 00:00:00 2001 From: Shivam Patel Date: Mon, 9 Feb 2026 01:01:12 -0500 Subject: [PATCH] Fix monitor.js missing from Docker image and SQLITE_CANTOPEN errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Copy monitor.js into the standalone build stage (was missing entirely) - Remove node-fetch require — Node 18 has global fetch built-in - Switch from bind mount (./data) to named volume (dashboard-data) so Docker manages permissions correctly for the nextjs user Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 2 ++ docker-compose.yml | 5 ++++- monitor.js | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 072a4ed..044425a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,8 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static # Create data directory for SQLite RUN mkdir -p /app/data && chown nextjs:nodejs /app/data +# Copy monitor script and startup script +COPY --from=builder --chown=nextjs:nodejs /app/monitor.js ./ COPY --chown=nextjs:nodejs start.sh ./ RUN chmod +x start.sh diff --git a/docker-compose.yml b/docker-compose.yml index 830c112..080f338 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,5 +11,8 @@ services: - NODE_ENV=production - DB_PATH=/app/data/dashboard.db volumes: - - ./data:/app/data + - dashboard-data:/app/data - /server_storage:/server_storage:ro + +volumes: + dashboard-data: diff --git a/monitor.js b/monitor.js index 00adedc..bd8925e 100644 --- a/monitor.js +++ b/monitor.js @@ -1,7 +1,6 @@ const sqlite3 = require('sqlite3'); const { open } = require('sqlite'); -const fetch = require('node-fetch'); // Native fetch in Node 18, but let's be safe or use global fetch -// Node 18 has global fetch, so we don't need node-fetch if running with node 18 +// Node 18+ has global fetch built-in const SERVICES = [ { name: 'Website', url: 'https://www.akkolli.net' },