Optimize Dockerfile: remove chown and USER for faster builds, add touch for database file

This commit is contained in:
Ryderjj89
2025-09-29 20:12:29 -04:00
parent 8b35f8cacf
commit eba89f987f

View File

@@ -18,14 +18,8 @@ COPY . .
# Build the application
RUN npm run build
# Create data directory for SQLite (in app directory for Docker)
RUN mkdir -p /app/data
# Set proper permissions for the data directory
RUN chown -R node:node /app/data
# Switch to non-root user
USER node
# Create data directory and database file for SQLite
RUN mkdir -p /app/data && touch /app/data/sermons.db
# Expose port
EXPOSE 3000