# Base image: Minimal LTS Node Alpine
FROM node:20-alpine

# Setup workspace environment
WORKDIR /usr/src/app

# Copy dependency manifests
COPY package*.json ./

# Install clean production dependencies
RUN npm ci --only=production

# Copy application source files
COPY . .

# Setup persistent volume mount point
RUN mkdir -p /usr/src/app/data

# Default port exposure
EXPOSE 3000

# Start command
CMD [ "npm", "start" ]
