From 94b64db7518cbad807334d22950ea965d0b62222 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Fri, 10 Apr 2026 13:45:41 +0200 Subject: [PATCH] Add .env setup instructions to Docker Hub docker-compose section --- DOCKER_HUB.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/DOCKER_HUB.md b/DOCKER_HUB.md index ef2a1bb..e6ec49f 100644 --- a/DOCKER_HUB.md +++ b/DOCKER_HUB.md @@ -148,7 +148,21 @@ When a config file is mounted, the `OPENCODE_PROVIDER` auto-config is skipped. ## Using docker-compose -Create a `docker-compose.yml`: +Create a `docker-compose.yml` and a `.env` file in the same directory: + +```bash +mkdir opencode-devbox && cd opencode-devbox +``` + +`.env` — your secrets and settings (never commit this): + +```bash +ANTHROPIC_API_KEY=sk-ant-... +GIT_USER_NAME=Your Name +GIT_USER_EMAIL=you@example.com +``` + +`docker-compose.yml`: ```yaml services: @@ -176,6 +190,8 @@ volumes: devbox-data: ``` +Docker Compose automatically loads `.env` from the same directory as the compose file. The `${VAR}` references are substituted with values from `.env`. + Then: ```bash