Skip to content

Instantly share code, notes, and snippets.

@dadair-ca
Created September 12, 2016 22:41
Show Gist options
  • Save dadair-ca/4a6788002de7f96f5c075c84570015b0 to your computer and use it in GitHub Desktop.
Save dadair-ca/4a6788002de7f96f5c075c84570015b0 to your computer and use it in GitHub Desktop.
version: "2"
services:
api:
build:
context: api
dockerfile: Dockerfile-dev
restart: "always"
volumes:
- "./api/src:/app/src"
ports:
- "80:3000"
FROM clojure
RUN mkdir -p /app
COPY ./dev /app/dev
COPY ./profiles.clj /app/profiles.clj
COPY ./project.clj /app/project.clj
COPY ./resources /app/resources
COPY ./src /app/src
WORKDIR /app
# fetch dependencies and build the runnable uberjar
RUN lein deps
RUN mv "$(lein uberjar | sed -n 's/^Created \(.*standalone\.jar\)/\1/p')" /app/app-standalone.jar
EXPOSE 3000
# run the uberjar
CMD ["java", "-jar", "app-standalone.jar"]
VOLUME /app/src /app/dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment