A docker image to run gorilla repl.
413
A docker image to run gorilla repl.
To run, run the following:
docker run -d
-v ~/workspaces/:/usr/src/app/ws/
-p 3000:3000
-p 7000:7000
--rm
--name gorilla-repl
akeboshiwind/gorilla-repl
This will:
ws/ folder in the container that saves worspaces to ~/workspaces/ on your host
ws/ directory.Just swap out akeboshiwind/gorilla-repl with akeboshiwind/gorilla-repl:boot.
Here's how I run it using docker-compose:
version: '3.5'
services:
gorilla-repl:
image: akeboshiwind/gorilla-repl:boot
container_name: gorilla-repl
restart: always
ports:
- 3000:3000
volumes:
- ./ws/:/usr/src/app/ws/
- ./data/:/usr/src/app/data/
Sometimes you'll want to add a dependancy to a notebook, to allow this without restarting the whole docker container I've included cemerick.pomegranate as a dependancy. It can be imported like below:
(use '[cemerick.pomegranate :only (add-dependencies)])
And new dependancies can be loaded like below:
(add-dependencies :coordinates '[[clj-http "3.9.1"]]
:repositories (merge cemerick.pomegranate.aether/maven-central
{"clojars" "https://clojars.org/repo"}))
The :repositories key is to allow loading from clojars, it needs to be included each time.
You can then require the dependancy like normal:
(require '[clj-http.client :as client])
Here's a quick function that ties it all together:
(defn add-deps
[deps-list]
(cemerick.pomegranate/add-dependencies
:coordinates deps-list
:repositories (merge cemerick.pomegranate.aether/maven-central
{"clojars" "https://clojars.org/repo"})))
For the leiningen version:
docker build -t gorilla-repl:lein -t gorilla-repl:latest .
For the boot version:
docker build -f Dockerfile.boot -t gorilla-repl:boot .
Content type
Image
Digest
Size
264.7 MB
Last updated
about 8 years ago
docker pull akeboshiwind/gorilla-repl