2024-06-12 06:58:45 +09:00

21 lines
410 B
Docker

# 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"]