# Development Dockerfile
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Install development dependencies
RUN apk add --no-cache curl
# Copy package files
COPY package*.json ./
# Install all dependencies (including dev dependencies)
RUN npm ci
# Copy source code
COPY . .
# Create non-root user for security
RUN addgroup -g 1001 -S nodejs && \
adduser -S codecompass -u 1001
# Set ownership of app directory
RUN chown -R codecompass:nodejs /app
# Switch to non-root user
USER codecompass
# Expose ports
EXPOSE 3000 9229
# Set environment variables
ENV NODE_ENV=development
ENV LOG_LEVEL=debug
# Start development server
CMD ["npm", "run", "dev"]