Skip to content

Instantly share code, notes, and snippets.

@seeflanigan
Last active April 18, 2020 07:23
Show Gist options
  • Save seeflanigan/5b72636d6e8881138919 to your computer and use it in GitHub Desktop.
Save seeflanigan/5b72636d6e8881138919 to your computer and use it in GitHub Desktop.
Docker Compose file for running Clojure Koans
koans:
image: clojure
command: lein koan run
volumes:
- ./clojure-koans:/clojure-koans
working_dir: /clojure-koans
repl:
image: clojure
command: lein repl
volumes:
- ./clojure-koans:/clojure-koans
working_dir: /clojure-koans
@seeflanigan
Copy link
Author

seeflanigan commented Jun 23, 2016

To use this file:

# Resolve host dependencies, and boot a local Docker environment
brew install docker docker-compose docker-machine
docker-machine start && eval $(docker-machine env)

# Create a new folder, and download the docker-compose file into it
mkdir clj-koans && cd clj-koans
curl -o https://gist.githubusercontent.com/seeflanigan/5b72636d6e8881138919/raw/f394b2beb2d0b459c2b1fc51c42e1c7471e2c3a0/docker-compose.yml

# Resolve project dependencies, and clone the clojure-koans repository
docker-compose pull
git clone git://github.com/functional-koans/clojure-koans.git
docker-compose run koans

# Run a REPL
docker-compose run repl

The docker-compose run koans command instantiates a long-running test process, which automatically re-runs tests when you edit the koan source files. It loads dependencies once, per instance. The REPL does not automatically update when source files are changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment