Skip to content
Merged
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
2 changes: 2 additions & 0 deletions examples/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Build an agent-specific image from the repository root:
docker build -f examples/docker/claude-code.Dockerfile -t sortie-claude .
docker build -f examples/docker/codex.Dockerfile -t sortie-codex .
docker build -f examples/docker/copilot.Dockerfile -t sortie-copilot .
docker build -f examples/docker/opencode.Dockerfile -t sortie-opencode .
```

Run it:
Expand All @@ -33,6 +34,7 @@ docker run --rm --init \
| `claude-code.Dockerfile` | Claude Code | `node:24-slim` |
| `codex.Dockerfile` | OpenAI Codex CLI | `debian:bookworm-slim` |
| `copilot.Dockerfile` | GitHub Copilot | `node:24-slim` |
| `opencode.Dockerfile` | OpenCode | `node:24-slim` |

Each Dockerfile follows the same pattern: copy the Sortie binary from the
distroless image (`ghcr.io/sortie-ai/sortie`), install the agent, create a
Expand Down
51 changes: 51 additions & 0 deletions examples/docker/opencode.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# examples/docker/opencode.Dockerfile
#
# Complete working example: Sortie + OpenCode agent.
#
# OpenCode requires Node.js (>= 18), npm, and git. It authenticates through
# provider environment variables such as ANTHROPIC_API_KEY or OPENAI_API_KEY.
# The container runs as a non-root user for security best practices.
#
# Build:
# docker build -f examples/docker/opencode.Dockerfile -t sortie-opencode .
#
# Run:
# docker run --rm --init \
# -e ANTHROPIC_API_KEY \
# -v "$(pwd)/workspaces:/home/sortie/workspaces" \
# -v "$(pwd)/WORKFLOW.md:/home/sortie/WORKFLOW.md:ro" \
# -p 7678:7678 \
# sortie-opencode /home/sortie/WORKFLOW.md

FROM ghcr.io/sortie-ai/sortie:latest AS sortie

FROM node:24-slim

# Install git for repository-backed runs.
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says only git is being installed, but this layer also installs wget (required for the HEALTHCHECK below). Consider updating the comment to reflect both packages so the dependency is clear.

Suggested change
# Install git for repository-backed runs.
# Install git for repository-backed runs and wget for the HEALTHCHECK below.

Copilot uses AI. Check for mistakes.
RUN apt-get update && apt-get install -y --no-install-recommends \
git wget && \
rm -rf /var/lib/apt/lists/*

# Install OpenCode globally.
RUN npm install -g opencode-ai@latest && npm cache clean --force

# Create a non-root user. The node base image ships a "node" user at UID 1000;
# remove it so we can claim that UID for the sortie user.
RUN userdel -r node 2>/dev/null; \
useradd --create-home --shell /bin/bash --uid 1000 sortie

# Copy the Sortie binary from the distroless image.
COPY --from=sortie /usr/bin/sortie /usr/bin/sortie

# Switch to the non-root user for all subsequent operations.
USER sortie
WORKDIR /home/sortie

# The HTTP observability server listens on all interfaces so the host
# can reach it through the published port.
EXPOSE 7678

HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO /dev/null http://localhost:7678/readyz || exit 1

ENTRYPOINT ["/usr/bin/sortie", "--host", "0.0.0.0", "--log-format", "json"]