|
|
@@ -23,6 +23,9 @@ WORKDIR /app
|
|
|
ENV NODE_ENV=production
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
|
|
+# Install su-exec for dropping privileges in entrypoint
|
|
|
+RUN apk add --no-cache su-exec
|
|
|
+
|
|
|
# Create non-root user
|
|
|
RUN addgroup --system --gid 1001 nodejs && \
|
|
|
adduser --system --uid 1001 nextjs
|
|
|
@@ -35,14 +38,22 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
|
# Copy CLMM SDK dist (native requires)
|
|
|
COPY --from=builder /app/src/lib/clmm-sdk/dist ./src/lib/clmm-sdk/dist
|
|
|
|
|
|
+# Copy better-sqlite3 native addon (standalone may miss it)
|
|
|
+COPY --from=builder /app/node_modules/better-sqlite3 ./node_modules/better-sqlite3
|
|
|
+COPY --from=builder /app/node_modules/bindings ./node_modules/bindings
|
|
|
+COPY --from=builder /app/node_modules/file-uri-to-path ./node_modules/file-uri-to-path
|
|
|
+
|
|
|
# Data directory for SQLite
|
|
|
RUN mkdir -p /app/data && chown nextjs:nodejs /app/data
|
|
|
VOLUME /app/data
|
|
|
|
|
|
-USER nextjs
|
|
|
+# Entrypoint to fix volume permissions then drop to nextjs user
|
|
|
+COPY docker-entrypoint.sh /usr/local/bin/
|
|
|
+RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
+
|
|
|
EXPOSE 3000
|
|
|
|
|
|
ENV HOSTNAME=0.0.0.0
|
|
|
ENV PORT=3000
|
|
|
|
|
|
-CMD ["node", "server.js"]
|
|
|
+ENTRYPOINT ["docker-entrypoint.sh"]
|