forked from pink-gorilla/notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (43 loc) · 1.75 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# https://ctr.run/documentation
# docker run ctr.run/github.com/pink-gorilla/gorilla-notebook[:commit-hash, branch-name, tag-name]
FROM clojure:openjdk-13-buster as build
MAINTAINER Andreas Steffan <a.steffan@contentreich.de>
LABEL vendor="Pink Gorilla" \
maintainer="a.steffan@contentreich.de" \
description="Pink Gorilla Notebook Builder" \
version="1.0"
ARG GIT_REF=master
ENV REPO=git://github.com/pink-gorilla/gorilla-notebook.git
ENV NVM_VERSION v0.31.2
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION stable
# TODO avoid duping with ./scripts (ci/cd)!
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
# TODO : Not quite sure what ctr.run actually prefers
# WTF? COPY/ADD
# https://stackoverflow.com/questions/26504846/copy-directory-to-other-directory-at-docker-using-add-command
#ADD src /tmp/src
#ADD resources /tmp/resources
#COPY project.clj package-lock.json package.json /tmp/
COPY . /tmp/gorilla-notebook
#RUN git clone ${REPO} && \
# cd gorilla-notebook && \
WORKDIR /tmp/gorilla-notebook
RUN . $NVM_DIR/nvm.sh && npm install
# RUN lein deps
# cat /etc/clojure-*.edn if lein threw up an it exists
RUN . $NVM_DIR/nvm.sh && lein with-profile +cljs uberjar
#FROM openjdk:13-jre
FROM openjdk:8-jre
COPY --from=build /tmp/gorilla-notebook/target/gorilla-notebook-*-standalone.jar /gorilla-notebook-standalone.jar
COPY --from=build /tmp/gorilla-notebook/docker/gorilla-notebook.sh /usr/bin/gorilla-notebook.sh
ENV GORILLA_HOME /
RUN mkdir /work
# RUN adduser --home /work --disabled-login --uid 2000 --gecos "" gorilla
# USER gorilla
WORKDIR /work
CMD ["gorilla-notebook.sh"]