Skip to content
Demo project for Between Two Parens Blog Post 005
CSS Dockerfile Clojure HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources/public
src/demo_clojurescript_nginx
test/demo_clojurescript_nginx
tools/docker/nginx
.gitignore
README.md
deps.edn
dev.cljs.edn
prod.cljs.edn

README.md

Demo ClojureScript Nginx

Quick Start - Dev

Build Prod Artifacts

clj -A:prod

Setup Nginx Webserver

This will show the steps involved in building the docker nginx webserver locally.

  • Build prod artifact image

    docker build -t \
                 demo-clojurescript-nginx/build:0.0.0 \
                 -f "tools/docker/nginx/Dockerfile.build" .
  • Run prod artifact container

    docker run -d \
             --name demo-clojurescript-nginx-build \
             demo-clojurescript-nginx/build:0.0.0 \
             sleep 20000
  • Move prod artifacts from above container to local filesystem

    mkdir temp
    mkdir temp/cljs-out
    docker cp demo-clojurescript-nginx-build:app/resources/public/index.html ./temp/index.html
    docker cp demo-clojurescript-nginx-build:app/resources/public/style.css ./temp/style.css
    docker cp demo-clojurescript-nginx-build:app/out/dev-main.js ./temp/cljs-out/dev-main.js
  • Build prod nginx image

    docker build -t \
               demo-clojurescript-nginx/prod:0.0.0 \
               -f "tools/docker/nginx/Dockerfile" .
  • Run prod nginx container

    docker run -d \
             -p 4001:4001 \
             --name demo-clojurescript-nginx-prod \
             demo-clojurescript-nginx/prod:0.0.0

Visit the site at http://localhost:4001

You can’t perform that action at this time.