# API Server Dockerfile FROM node:18-alpine WORKDIR /app # Copy package files COPY package*.json ./ # Install only production dependencies RUN npm ci --only=production # Copy database and server files COPY database ./database COPY server.js . # Expose API port EXPOSE 3001 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD node -e "require('http').get('http://localhost:3001/api/categories', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})" # Start the API server CMD ["node", "server.js"]