adding opencode to the environment

This commit is contained in:
2026-04-04 17:07:29 +00:00
parent 590037e1c4
commit d983027450
4 changed files with 47 additions and 0 deletions

3
.gitignore vendored
View File

@@ -44,3 +44,6 @@ Thumbs.db
*.zip *.zip
*.sas7bdat *.sas7bdat
*.parquet *.parquet
.opencode-sandbox/.env

View File

@@ -0,0 +1,19 @@
FROM archlinux:latest
# Network restriction — only allow git.processhub.work
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm \
nodejs \
npm \
git \
iptables \
opencode \
&& pacman -Scc --noconfirm
# Firewall script — blocks everything except your Gitea instance
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
WORKDIR /workspace
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,23 @@
services:
opencode:
build:
context: .
dockerfile: Dockerfile
image: opencode-sandbox
container_name: opencode
cap_add:
- NET_ADMIN # required for iptables in entrypoint
- NET_RAW
volumes:
# Your monorepo — opencode's working directory
- ../:/workspace
# Persist opencode auth so you don't re-login every time
- opencode-auth:/root/.local/share/opencode
environment:
- OPENCODE_API_KEY=${OPENCODE_API_KEY}
stdin_open: true
tty: true
working_dir: /workspace
volumes:
opencode-auth:

View File

@@ -0,0 +1,2 @@
#!/bin/bash
exec opencode