# Production Dockerfile
FROM node:20-alpine

# Set working directory
WORKDIR /app

# Install dependencies first for efficient caching
COPY package*.json ./
RUN npm ci --only=production

# Copy application source and public assets
COPY . .

# Expose server port
EXPOSE 3000

# Default environment
ENV NODE_ENV=production
ENV PORT=3000

# Volume for persistent SQLite database storage
VOLUME ["/app/data"]

# Start server
CMD ["node", "src/server.js"]
