Add .env setup instructions to Docker Hub docker-compose section
This commit is contained in:
+17
-1
@@ -148,7 +148,21 @@ When a config file is mounted, the `OPENCODE_PROVIDER` auto-config is skipped.
|
|||||||
|
|
||||||
## Using docker-compose
|
## 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
|
```yaml
|
||||||
services:
|
services:
|
||||||
@@ -176,6 +190,8 @@ volumes:
|
|||||||
devbox-data:
|
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:
|
Then:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in New Issue
Block a user