# Use the official Node.js image with Alpine FROM node:alpine # Create and change to the app directory WORKDIR /usr/src/app # Copy package.json and package-lock.json files to the working directory COPY package*.json ./ # Install the dependencies RUN npm install # Copy the application source COPY . . # Expose the MQTT port EXPOSE 1883 # Run the MQTT broker CMD ["node", "broker.js"]