diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2019-03-27 19:42:24 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2019-03-27 19:54:05 +0000 |
| commit | 2ca1b0cf819604a617f875cb7a398a48cd55ea54 (patch) | |
| tree | 9f006db63e16538dfef799fd75dd3bf3b9c8f6ee | |
| parent | initial commit (diff) | |
| download | redirectly-2ca1b0cf819604a617f875cb7a398a48cd55ea54.tar.gz redirectly-2ca1b0cf819604a617f875cb7a398a48cd55ea54.zip | |
deployability
| -rw-r--r-- | .dockerignore | 11 | ||||
| -rw-r--r-- | .gitignore | 12 | ||||
| -rw-r--r-- | Dockerfile | 12 | ||||
| -rw-r--r-- | project.clj | 6 | ||||
| -rw-r--r-- | src/redirectly/deploy.clj | 7 |
5 files changed, 44 insertions, 4 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5fdcfab --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +/target +/classes +/checkouts +profiles.clj +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port +Dockerfile @@ -1,2 +1,10 @@ -.lein-repl-history -target +/target +/classes +/checkouts +profiles.clj +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a77f81a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM java:8-alpine AS build-env +ADD https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein /bin/lein +RUN apk update && apk add bash openssl +RUN /bin/chmod +x /bin/lein && lein +COPY . /build +RUN cd /build && lein uberjar + +FROM java:8-alpine +RUN mkdir -p /app/config +COPY --from=build-env /build/target/redirectly-*-standalone.jar /app/redirectly-standalone.jar +CMD java -cp /app/config:/app/redirectly-standalone.jar redirectly.deploy +EXPOSE 3000 diff --git a/project.clj b/project.clj index 9ae0b54..e9df16b 100644 --- a/project.clj +++ b/project.clj @@ -7,5 +7,7 @@ :dependencies [[org.clojure/clojure "1.10.0"] [sonian/carica "1.2.2"] [ring/ring-core "1.7.1"] - [ring/ring-jetty-adapter "1.7.1"] - [ring-logger "1.0.1"]]) + [ring/ring-jetty-adapter "1.7.1"]] + :main redirectly.deploy + :profiles {:uberjar {:aot :all}}) + ; :jar-exclusions [#"^config\.edn$"]) diff --git a/src/redirectly/deploy.clj b/src/redirectly/deploy.clj new file mode 100644 index 0000000..48fe0a7 --- /dev/null +++ b/src/redirectly/deploy.clj @@ -0,0 +1,7 @@ +(ns redirectly.deploy
+ (:gen-class)
+ (:require [ring.adapter.jetty :refer [run-jetty]]
+ [redirectly.core :refer [handler]]))
+
+(defn -main [& args]
+ (run-jetty handler {:port 3000}))
|
