Configure docker build
This commit is contained in:
parent
9b7f2f2efb
commit
321a4c4f57
4 changed files with 26 additions and 3 deletions
6
.dockerignore
Normal file
6
.dockerignore
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
.cpcache
|
||||
.shadow-cljs
|
||||
node_modules
|
||||
resources/public/js
|
||||
.git
|
||||
target
|
||||
17
Dockerfile
Normal file
17
Dockerfile
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
FROM theasp/clojurescript-nodejs:shadow-cljs-alpine as build
|
||||
WORKDIR /app
|
||||
# RUN apk --no-cache add python alpine-sdk
|
||||
|
||||
COPY package.json package-lock.json deps.edn shadow-cljs.edn /app/
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
RUN clojure -A:cljs -m shadow.cljs.devtools.cli release app
|
||||
RUN clojure -A:uberjar
|
||||
|
||||
FROM alpine:3.9
|
||||
RUN apk add --no-cache openjdk8
|
||||
WORKDIR /app
|
||||
COPY --from=build /app /app
|
||||
RUN cd /app/target/ && mv *-standalone.jar app-standalone.jar
|
||||
CMD java -cp /app/target/app-standalone.jar heyarne.all_my_friends.server
|
||||
4
deps.edn
4
deps.edn
|
|
@ -1,6 +1,6 @@
|
|||
{:paths ["src" "resources"]
|
||||
:extra-paths ["resources"]
|
||||
:deps {environ {:mvn/version "1.1.0"}
|
||||
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
|
||||
environ {:mvn/version "1.1.0"}
|
||||
http-kit {:mvn/version "2.3.0"}
|
||||
compojure {:mvn/version "1.6.1"}
|
||||
ring-logger {:mvn/version "1.0.1"}}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
|
||||
(defn -main [& args]
|
||||
(let [port (env :port 8081)]
|
||||
(let [port (Integer/parseInt (env :port "8081"))]
|
||||
(println "Starting server on port" port)
|
||||
(reset! server (-> #'app
|
||||
(logger/wrap-with-logger)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue