forked from dhis2/dhis2-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (28 loc) · 1020 Bytes
/
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
#
# Build the base DHIS2 image
#
FROM maven:3.6.3-jdk-8-slim as build
ARG IDENTIFIER=unknown
LABEL identifier=${IDENTIFIER}
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
git && \
rm -rf /var/lib/apt/lists/*
WORKDIR /src
# NB: web-apps build uses `git rev-parse` to tag the build, so just copy over the whole tree for now
COPY dhis-2 .
# TODO: We should be able to achieve much faster incremental builds and cached dependencies using
RUN mvn clean install -T1C -f pom.xml -DskipTests
RUN mvn clean install -T1C -U -f dhis-web/pom.xml -DskipTests
RUN cp dhis-web/dhis-web-portal/target/dhis.war /dhis.war && \
cd / && \
sha256sum dhis.war > /sha256sum.txt && \
md5sum dhis.war > /md5sum.txt
#
# Slim final image that has the build artifacts at /srv/dhis2
#
FROM alpine:latest
COPY --from=build /dhis.war /srv/dhis2/dhis.war
COPY --from=build /sha256sum.txt /srv/dhis2/sha256sum.txt
COPY --from=build /md5sum.txt /srv/dhis2/md5sum.txt