Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules/
dist/
.git/
*.db
*.db-journal
*.db-wal
*.db-shm
.env
.DS_Store
*.tgz
.automaton/
coverage/
.github/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ dist/
*.tgz
.automaton/wallet.json
.automaton/state.db
.claude/
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ── Build stage ──────────────────────────────────────────────
FROM node:20-slim AS build

RUN corepack enable && corepack prepare pnpm@10.28.1 --activate

# Native build deps for better-sqlite3
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/cli/package.json packages/cli/
RUN pnpm install --frozen-lockfile

COPY tsconfig.json ./
COPY src/ src/
COPY packages/ packages/
RUN pnpm build

# ── Runtime stage ────────────────────────────────────────────
FROM node:20-slim

RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

RUN useradd --create-home --shell /bin/bash automaton
RUN mkdir -p /home/automaton/.automaton && chown automaton:automaton /home/automaton/.automaton
USER automaton
WORKDIR /home/automaton/app

COPY --from=build --chown=automaton:automaton /app/dist ./dist
COPY --from=build --chown=automaton:automaton /app/node_modules ./node_modules
COPY --from=build --chown=automaton:automaton /app/packages ./packages
COPY --from=build --chown=automaton:automaton /app/package.json ./

ENV HOME=/home/automaton
ENV NODE_ENV=production

STOPSIGNAL SIGTERM

ENTRYPOINT ["node", "dist/index.js"]
CMD ["--run"]
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ For automated sandbox provisioning:
curl -fsSL https://conway.tech/automaton.sh | sh
```

## Docker Deployment

Run an automaton on any server or cloud provider with Docker:

```bash
git clone https://github.com/Conway-Research/automaton.git
cd automaton
docker compose up -d
```

On first run, attach to the container to complete the interactive setup wizard:

```bash
docker attach $(docker compose ps -q automaton)
```

Once setup completes, the automaton runs autonomously. Detach with `Ctrl+P, Ctrl+Q`. All state (wallet, database, config) persists in a Docker volume across restarts.

To view logs:
```bash
docker compose logs -f
```

## How It Works

Every automaton runs a continuous loop: **Think → Act → Observe → Repeat.**
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
automaton:
build: .
restart: unless-stopped
stdin_open: true # Required for interactive setup wizard on first run
tty: true # Required for interactive setup wizard on first run
volumes:
- automaton-data:/home/automaton/.automaton
environment:
- CONWAY_API_URL=${CONWAY_API_URL:-https://api.conway.tech}
- CONWAY_API_KEY=${CONWAY_API_KEY:-}

volumes:
automaton-data: