Fix deployment issues: native modules, volume mapping, Nuxt 4 config

This commit is contained in:
2025-10-01 21:41:13 -04:00
parent 34f88316ff
commit fe4394241e
4 changed files with 18 additions and 16 deletions

View File

@@ -22,20 +22,26 @@ RUN npm run build
# Stage 2: Runner
FROM node:24-alpine
# Install dumb-init for signal handling
RUN apk add --no-cache dumb-init
# Install dumb-init, wget for healthcheck, and build tools for native modules
RUN apk add --no-cache dumb-init wget python3 build-base
# Set working directory
WORKDIR /app
# Copy only production dependencies from builder stage
# Copy package files for rebuilding native modules
COPY --from=builder /app/package*.json ./
# Copy node_modules from builder
COPY --from=builder /app/node_modules ./node_modules
# Rebuild native modules for production environment
RUN npm rebuild better-sqlite3
# Copy the built application from builder stage
COPY --from=builder /app/.output ./.output
# Create data directory and database file for SQLite
RUN mkdir -p /app/data && touch /app/data/sermons.db
# Create data directory (don't pre-create database file)
RUN mkdir -p /app/data
# Expose port
EXPOSE 3000