Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Use the official Clojure image for building
FROM clojure:temurin-23-tools-deps-bullseye-slim

# Set working directory
WORKDIR /app

# Copy only deps.edn (or project.clj) first to cache dependencies layer
COPY deps.edn ./

# Install dependencies. This step will be cached unless deps.edn changes
RUN clojure -P

# Now copy the rest of the application source code
COPY . .

# Install Node.js and npm (if needed for Figwheel or other tasks)
RUN apt-get update && apt-get install -y nodejs npm

# Build a static html/js page
RUN clojure -M:build-prod

# Build the SASS file
RUN clojure -M:build-sass

# Expose the application port
EXPOSE 9500

# Run Figwheel with the options from :main-opts
CMD ["clojure", "-M:build-prod-server"]


14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ clean:
rm -rf target node_modules package.json package-lock.json gh_pages *.log resources/public/css/style.css*

watch-sass:
clojure -A:watch-sass
clojure -M:watch-sass

dev-repl:
clojure -A:fig:build
clojure -M:fig:build

test-cljs:
clojure -Afig:test-cljs
clojure -Mfig:test-cljs

test-clj:
clojure -Atest-clj
clojure -Mtest-clj

ci: test-cljs test-clj

build-prod:
clojure -Abuild-prod
clojure -Mbuild-prod

build-prod-server:
clojure -Abuild-prod-server
clojure -Mbuild-prod-server

build-sass:
clojure -Abuild-sass
clojure -Mbuild-sass

gh_pages: build-prod build-sass
mkdir -p gh_pages/cljs-out
Expand Down
38 changes: 20 additions & 18 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
org.clojure/clojurescript {:mvn/version "1.10.520"}
org.clojure/core.async {:mvn/version "0.4.490"}
reagent {:mvn/version "0.8.1"}
re-frame {:mvn/version "0.10.6"}
reagent/reagent {:mvn/version "0.8.1"}
re-frame/re-frame {:mvn/version "0.10.6"}
com.yetanalytics/xapi-schema
{:git/url "https://github.com/yetanalytics/xapi-schema.git"
:sha "e2c517e7adcedc7f3012b90bce274e2c33cdbcc1"}
:sha "f045cdb9e8fc23ec90d4ee043fdea7b6613667d1"}
com.cognitect/transit-cljs {:mvn/version "0.8.256"}
cljsjs/vega {:mvn/version "5.9.0-0"}
cljsjs/vega-tooltip {:mvn/version "0.20.0-0"}
cljs-http {:mvn/version "0.1.45"}
clj-http {:mvn/version "3.9.1"}
cljs-http/cljs-http {:mvn/version "0.1.45"}
clj-http/clj-http {:mvn/version "3.9.1"}
com.andrewmcveigh/cljs-time {:mvn/version "0.5.2"}
clj-time {:mvn/version "0.15.0"}
clj-time/clj-time {:mvn/version "0.15.0"}
org.clojure/data.json {:mvn/version "0.2.6"}
net.cgrand/macrovich {:mvn/version "0.2.1"}
re-codemirror {:git/url "https://github.com/yetanalytics/re-codemirror.git"
:sha "1408fc5cb3cc0f5800a7e498d3e6dbaac6d981ad"
re-codemirror/re-codemirror {:git/url "https://github.com/yetanalytics/re-codemirror.git"
:sha "ae0c0437bb3cd20d9cc49db5f444c0e3c7ca5c2f"
:exclusions [org.clojure/clojurescript
reagent]}
datascript {:mvn/version "0.18.8"}
datascript-transit {:mvn/version "0.3.0"}}
:paths ["src" "resources"]
reagent/reagent
deraen/sass4clj]}
datascript/datascript {:mvn/version "0.18.8"}
datascript-transit/datascript-transit {:mvn/version "0.3.0"}}
:paths ["src" "resources" "target"]
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
com.bhauman/figwheel-main {:mvn/version "0.2.0"}
com.bhauman/figwheel-main {:mvn/version "0.2.18"}
day8.re-frame/re-frame-10x {:mvn/version "0.3.3-react16"}
cheshire {:mvn/version "5.8.1"}
cheshire/cheshire {:mvn/version "5.8.1"}
org.clojure/test.check {:mvn/version "0.10.0-alpha3"}}
:extra-paths ["target" "test" "dev"]}
:watch-sass {:extra-deps
{com.yetanalytics/sassenach {:mvn/version "0.1.1"}}
{com.yetanalytics/sassenach {:git/url "https://github.com/RaceRocks/sassenach.git"
:sha "93641a125aca6ff6c98ab51ee9c978baa242e4fe"}}
:main-opts ["-m" "com.yetanalytics.sassenach"
;; input path
"resources/dave/ui/sass/style.scss"
Expand All @@ -51,13 +53,13 @@
:main-opts ["-m" "cognitect.test-runner"]}
;; for building a static html/js page
:build-prod
{:extra-deps {com.bhauman/figwheel-main {:mvn/version "0.2.0"}}
{:extra-deps {com.bhauman/figwheel-main {:mvn/version "0.2.18"}}
:main-opts ["-m" "figwheel.main" "-O" "simple" "-bo" "prod"]}
;; same as build-prod, but launches a figwheel server to debug/preview
:build-prod-server
{:extra-deps {com.bhauman/figwheel-main {:mvn/version "0.2.0"}}
{:extra-deps {com.bhauman/figwheel-main {:mvn/version "0.2.18"}}
:main-opts ["-m" "figwheel.main" "-O" "simple" "-bo" "prod" "-s"]}
;; run sass compilation once, sans source-map
:build-sass
{:extra-deps {deraen/sass4clj {:mvn/version "0.3.1"}}
{:extra-deps {deraen/sass4clj {:mvn/version "0.6.0"}}
:main-opts ["-e" "(require,'sass4clj.core),(sass4clj.core/sass-compile-to-file,\"resources/dave/ui/sass/style.scss\",\"resources/public/css/style.css\",{:source-map,false,:source-paths,[\"node_modules\"]})"]}}}