# Build a small production image for the SPORE website
FROM node:20-alpine

# Set working directory
WORKDIR /app

# Install only production dependencies first (leverage build cache)
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev || npm install --omit=dev

# Copy application files
COPY public ./public
COPY server.js ./server.js

# App runs on 3002 by default; allow override via PORT
ENV NODE_ENV=production \
    PORT=3002

EXPOSE 3002

# Start the server
CMD ["node", "server.js"]


