# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
FROM node:lts-alpine
# Create app directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json first
COPY package*.json ./
# Install dependencies without running scripts
RUN npm install --ignore-scripts
# Copy all source files
COPY . .
# Create a dummy .env file if one does not exist, so that the build script doesn't fail
RUN if [ ! -f .env ]; then \
echo 'HOME_ASSISTANT_URL=http://localhost:8123' > .env && \
echo 'HOME_ASSISTANT_TOKEN=dummy' >> .env; \
fi
# Build the project
RUN npm run build
# Expose port if needed (MCP over stdio doesn't require exposure)
# Start the server
CMD [ "npm", "start" ]