Fix deployment issues: native modules, volume mapping, Nuxt 4 config
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user