21 lines
419 B
Docker
21 lines
419 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 3000 1883 8888
|
|
|
|
# Run the MQTT broker
|
|
CMD ["node", "index.js"]
|