-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
83 lines (67 loc) · 2.77 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Verified with http://hadolint.lukasmartinelli.ch/
FROM hbpmip/scala-base-build:1.2.8-0 as scala-build-env
# First caching layer: build.sbt and sbt configuration
COPY build.sbt .dockerimage /build/
RUN mkdir -p /build/project/
COPY project/build.properties project/plugins.sbt project/.gitignore /build/project/
# Run sbt on an empty project and force it to download most of its dependencies to fill the cache
RUN sbt -mem 1500 compile
# Second caching layer: project sources
COPY src/ /build/src/
COPY docker/ /build/docker/
COPY .git/ /build/.git/
COPY .github/ /build/.github/
COPY .circleci/ /build/.circleci/
COPY tests/ /build/tests/
COPY docs/ /build/docs/
COPY dev/ /build/dev/
COPY .*.cfg .*ignore .*.yaml .*.conf .gitattributes *.md *.sh *.yml *.json *.txt Dockerfile LICENSE /build/
RUN /check-sources.sh
LABEL build=true
RUN sbt -mem 1500 test assembly
FROM hbpmip/java-base:11.0.1-1
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-cacert \
&& rm -rf /var/lib/apt/lists/*
COPY docker/woken.sh /opt/woken/
COPY docker/lets-encrypt-install.sh /opt/woken/
COPY docker/weaver-agent.sh /opt/woken/
RUN addgroup woken \
&& adduser --system --disabled-password --uid 1000 --ingroup woken woken \
&& chmod +x /opt/woken/woken.sh \
&& ln -s /opt/woken/woken.sh /run.sh \
&& chown -R woken:woken /opt/woken \
&& chmod +x /opt/woken/lets-encrypt-install.sh \
&& /opt/woken/lets-encrypt-install.sh \
&& chmod +x /opt/woken/weaver-agent.sh \
&& /opt/woken/weaver-agent.sh
COPY --from=scala-build-env /build/target/scala-2.11/woken-all.jar /opt/woken/woken.jar
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
USER woken
ENV HOME=/home/woken \
APP_NAME="Woken" \
APP_TYPE="Scala" \
VERSION=$VERSION \
BUILD_DATE=$BUILD_DATE \
BUGSNAG_KEY=4cfb095348013b4424338126f23da70b
WORKDIR /home/woken
ENTRYPOINT ["/run.sh"]
# 8087: Web service API, health checks on http://host:8087/health
# 8088: Akka cluster
# 9095: Prometheus reporter
EXPOSE 8087 8088 9095
HEALTHCHECK --start-period=60s CMD curl -v --silent http://localhost:8087/health 2>&1 | grep UP
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="hbpmip/woken" \
org.label-schema.description="An orchestration platform for Docker containers running data mining algorithms" \
org.label-schema.url="https://github.com/LREN-CHUV/woken" \
org.label-schema.vcs-type="git" \
org.label-schema.vcs-url="https://github.com/LREN-CHUV/woken" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.version="$VERSION" \
org.label-schema.vendor="LREN CHUV" \
org.label-schema.license="AGPLv3" \
org.label-schema.docker.dockerfile="Dockerfile" \
org.label-schema.memory-hint="2048" \
org.label-schema.schema-version="1.0"