| docs | ||
| scripts | ||
| .gitignore | ||
| Dockerfile | ||
| README.md | ||
Hero Docker Container
Introduction
A Docker-based development environment for Hero development with essential tools and configurations. This container comes pre-installed with Bun, Redis, and the Hero CLI.
Prerequisites
- Docker installed on your system
- SSH keys for deploying Hero websites (if publishing)
Build the Image
Build the Docker image:
docker build -t hero_docker .
Run the Container
Run the container with an interactive shell, mounting your current directory as the workspace and your SSH keys:
docker run --network=host \
-v $(pwd):/workspace \
-v ~/.ssh:/root/ssh \
-it hero_docker
By default, the container will:
- Start Redis server in the background
- Copy your SSH keys to the proper location
- Initialize the SSH agent
- Add your default SSH key (
id_ed25519)
To use a different SSH key, specify it with the KEY environment variable (e.g. KEY=id_ed25519):
docker run --network=host \
-v $(pwd):/workspace \
-v ~/.ssh:/root/ssh \
-e KEY=your_custom_key_name \
-it hero_docker
Launch the Hero Website
To start a Hero Docusaurus website in development mode:
- Build the book then close the prompt with
Ctrl+Chero docs -d - See the book on the local browser
bash /root/hero/var/docs/develop.sh
You can then view the website in your browser at https://localhost:3100.
Publish a Website
- To build and publish a Hero website:
- Development
hero docs -bpd - Production
hero docs -bp
- Development
If you want to specify a different SSH key, use -dk:
hero docs -bpd -dk ~/.ssh/id_ed25519
Note: The container handles the SSH agent and key management automatically on startup, so in most cases, you won't need to manually specify keys.