Optimize Dockerfile: remove chown and USER for faster builds, add touch for database file
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user