FROM debian:bullseye ARG OPENAI_API_KEY # Install Node.js and required dependencies RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ ca-certificates \ gcc \ libc6-dev \ wget \ curl \ gnupg \ bzip2 \ libdbus-1-dev \ libxcb1 \ libxcb-render0 \ libxcb-shape0 \ libxcb-xfixes0 \ git \ zip \ unzip \ ; \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - ; \ apt-get install -y nodejs; \ apt-get clean; \ rm -rf /var/lib/apt/lists/* # Install Node.js 20 RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - RUN apt-get update && apt-get install -y nodejs # Create user with home directory RUN useradd -m -s /bin/bash goose && \ usermod -aG sudo goose && \ echo "goose ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers COPY agent/.config/goose/config.yaml /home/goose/.config/goose/config.yaml COPY agent/.bashrc /home/goose/.bashrc COPY entrypoint.sh /home/goose/entrypoint.sh COPY instructions.md /home/goose/instructions.md RUN chmod +x /home/goose/entrypoint.sh # Switch to non-root user USER goose WORKDIR /home/goose RUN curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | CANARY=true bash RUN git clone https://github.com/hekmon8/homeassistant-server-mcp homeassistant-server-mcp && \ cd homeassistant-server-mcp && \ npm install && \ npm run build COPY homeassistant-mcp/.env /home/goose/homeassistant-mcp/.env ENTRYPOINT ["/home/goose/entrypoint.sh"]