fix: copy node_modules to Docker container for better-sqlite3 native dependencies

This commit is contained in:
Marko Djordjevic 2026-02-12 15:32:19 +01:00
parent 8646777f8d
commit 4e13648ebf
2 changed files with 7 additions and 1 deletions

View file

@ -16,12 +16,18 @@ FROM node:20-alpine
WORKDIR /app
# Install build dependencies for better-sqlite3
RUN apk add --no-cache python3 make g++
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Copy node_modules for native dependencies like better-sqlite3
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
RUN mkdir -p /app/public /app/data && chown -R nextjs:nodejs /app/public /app/data
ENV NODE_ENV=production PORT=3000 HOSTNAME=0.0.0.0

2
next-env.d.ts vendored
View file

@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.