Skip to content

Instantly share code, notes, and snippets.

@beetleman
Created July 29, 2018 22:00
Show Gist options
  • Save beetleman/2e557bb0a475d15780cf3a3b6d75f425 to your computer and use it in GitHub Desktop.
Save beetleman/2e557bb0a475d15780cf3a3b6d75f425 to your computer and use it in GitHub Desktop.
diff --git a/.gitignore b/.gitignore
index 00f42c8..e61feea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@ profiles.clj
/.env
.nrepl-port
/log
+/.m2
diff --git a/docker-compose-base.yml b/docker-compose-base.yml
new file mode 100644
index 0000000..8975a96
--- /dev/null
+++ b/docker-compose-base.yml
@@ -0,0 +1,24 @@
+version: "2.2"
+
+services:
+ build-base:
+ image: clojure:lein-2.8.1
+ volumes:
+ - ./:$PWD
+ working_dir: $PWD
+ environment:
+ - DATABASE_URL=mongodb://db:27017/the-game
+
+ dev-base:
+ extends:
+ service: build-base
+ environment:
+ - HOST=0.0.0.0
+ - PORT=3000
+ ports:
+ - "7000:7000"
+ - "3000:3000"
+
+ test-base:
+ extends:
+ service: build-base
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..0aa9fc6
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,41 @@
+version: "2.2"
+
+services:
+ app:
+ links:
+ - mongo:db
+ extends:
+ file: ./docker-compose-base.yml
+ service: dev-base
+ command: lein run
+
+ repl:
+ links:
+ - mongo:db
+ extends:
+ file: ./docker-compose-base.yml
+ service: dev-base
+ command: lein repl :headless :host 0.0.0.0 :port 7000
+
+ test-watch:
+ extends:
+ file: ./docker-compose-base.yml
+ service: test-base
+ links:
+ - mongo-test:db
+ tty: true
+ command: lein test-refresh
+
+ test:
+ extends:
+ file: ./docker-compose-base.yml
+ service: test-base
+ links:
+ - mongo-test:db
+ command: lein test
+
+ mongo:
+ image: mongo:4.0.0
+
+ mongo-test:
+ image: mongo:4.0.0
diff --git a/project.clj b/project.clj
index c7de5bd..f17c0ee 100644
--- a/project.clj
+++ b/project.clj
@@ -3,6 +3,9 @@
:description "FIXME: write description"
:url "http://example.com/FIXME"
+ :local-repo "./.m2"
+ :repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}
+
:dependencies [[buddy "2.0.0"]
[clj-time "0.14.4"]
[com.google.guava/guava "20.0"]
@@ -32,7 +35,7 @@
[selmer "1.11.8"]]
:min-lein-version "2.0.0"
-
+
:source-paths ["src/clj"]
:test-paths ["test/clj"]
:resource-paths ["resources"]
@@ -53,13 +56,16 @@
:test [:project/dev :project/test :profiles/test]
:project/dev {:jvm-opts ["-Dconf=dev-config.edn"]
- :dependencies [[expound "0.7.1"]
+ :dependencies [[org.clojure/tools.nrepl "0.2.13" :exclusions [org.clojure/clojure]]
+ [expound "0.7.1"]
[pjstadig/humane-test-output "0.8.3"]
[prone "1.6.0"]
[ring/ring-devel "1.6.3"]
[ring/ring-mock "0.3.2"]]
- :plugins [[com.jakemccrary/lein-test-refresh "0.23.0"]]
-
+ :plugins [[com.jakemccrary/lein-test-refresh "0.23.0"]
+ [refactor-nrepl "2.4.0-SNAPSHOT"]
+ [cider/cider-nrepl "0.18.0-SNAPSHOT"]]
+
:source-paths ["env/dev/clj"]
:resource-paths ["env/dev/resources"]
:repl-options {:init-ns user}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment