Docker Environment Variables
This document describes the environment variables used when running crocbot in Docker.Required Variables
| Variable | Description | Example |
|---|---|---|
CROCBOT_GATEWAY_TOKEN | Authentication token for the gateway API | your-secure-token |
Optional Variables
| Variable | Default | Description |
|---|---|---|
CROCBOT_GATEWAY_PORT | 18789 | Port for the gateway HTTP/WebSocket server |
CROCBOT_GATEWAY_BIND | lan | Network binding: loopback, lan, or all |
CROCBOT_BRIDGE_PORT | 18790 | Port for the bridge service |
CROCBOT_CONFIG_DIR | - | Host path to mount at /home/node/.crocbot |
CROCBOT_WORKSPACE_DIR | - | Host path to mount at /home/node/croc |
CROCBOT_IMAGE | crocbot:local | Docker image to use |
NODE_ENV | production | Node.js environment (set in Dockerfile) |
HOME | /home/node | Home directory (set in compose) |
TERM | xterm-256color | Terminal type (set in compose) |
Usage with docker-compose
Create a.env file in the same directory as docker-compose.yml:
Usage with docker run
First-Time Setup
Before running the gateway for the first time, you need to configure it:-
Run the setup wizard (interactive):
-
Or set
gateway.mode=localin configuration to skip setup validation:
--allow-unconfigured to the command.
Security Notes
- Never commit
.envfiles containing real tokens to version control - Use Docker secrets or a secrets manager in production
- The
CROCBOT_GATEWAY_TOKENshould be a strong, unique value - Container runs as non-root
nodeuser for security
