Skip to content

Commit 9ca1c9c

Browse files
CoderYellowclaude
andcommitted
Document Docker usage in CONTRIBUTING.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a5f0040 commit 9ca1c9c

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,56 @@ java -jar target/crux-console.jar --embed-crux true
201201
and `lein build-ebs` additionally packs an AWS Elastic Beanstalk bundle
202202
(see `dev/build-ebs.sh`).
203203

204+
## Docker
205+
206+
Prebuilt images are published to GitHub Container Registry by the
207+
[Build and Release Docker Image](.github/workflows/docker.yml) workflow on
208+
every push to `master` (tagged `latest`, `master`, `sha-<commit>`) and on
209+
`v*` git tags (tagged semver, e.g. `1.2.3` and `1.2`).
210+
211+
### Run
212+
213+
```sh
214+
docker run -p 5000:5000 -p 8080:8080 \
215+
-v crux-data:/app/data \
216+
ghcr.io/openprojectx/crux-console:latest
217+
```
218+
219+
Open <http://localhost:5000/console>. Notes:
220+
221+
- The default command runs with an **embedded Crux node**
222+
(`--embed-crux true --crux-node-url-base '"localhost:8080"'`).
223+
- **Publish both ports**: 5000 serves the console, 8080 is the Crux HTTP API
224+
that the *browser* calls directly. If you map 8080 to a different host
225+
port, override `--crux-node-url-base` to match what the browser can reach,
226+
e.g. `docker run ... ghcr.io/openprojectx/crux-console:latest
227+
--embed-crux true --crux-node-url-base '"localhost:9090"'`
228+
(arguments after the image name replace the default command and are passed
229+
to the console server).
230+
- The embedded node persists RocksDB data in the `/app/data` volume — reuse
231+
the same named volume to keep your data across container restarts.
232+
- To use an external Crux node instead, drop `--embed-crux` and point
233+
`--crux-node-url-base` at the node (must be reachable from the browser and
234+
CORS-enabled).
235+
236+
### Build locally
237+
238+
```sh
239+
docker build -t crux-console .
240+
```
241+
242+
The `Dockerfile` is multi-stage: a `clojure:temurin-17-lein` stage compiles
243+
the frontend (`shadow-cljs release app`) and packs `crux-console.jar`
244+
(`lein with-profile base:crux-jars uberjar`); the runtime image is a plain
245+
JRE with the jar.
246+
247+
### Release a version
248+
249+
```sh
250+
git tag v1.0.0
251+
git push OpenProjectX v1.0.0 # CI publishes ghcr.io/openprojectx/crux-console:1.0.0
252+
```
253+
204254
## Code style / architecture notes
205255

206256
- Frontend state management is re-frame: events and subscriptions are under

0 commit comments

Comments
 (0)