Add SQLite visitor IP logging to /server_storage
All checks were successful
Deploy Website / build-and-deploy (push) Successful in 1m9s

Log visitor IPs and paths to a local SQLite database via the existing
analytics API route, persisted at /server_storage/visitors.db in Docker
(falls back to ./visitors.db in dev).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Shivam Patel
2026-02-09 00:04:45 -05:00
parent 73eb9264df
commit 4a01928fe7
6 changed files with 481 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ FROM node:20-alpine AS base
# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk add --no-cache libc6-compat python3 make g++
WORKDIR /app
# Install dependencies based on the preferred package manager
@@ -35,6 +35,9 @@ RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
# Create server_storage directory for SQLite DB
RUN mkdir -p /server_storage && chown nextjs:nodejs /server_storage
# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next