Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (56 loc) · 2.19 KB
/
Copy pathDockerfile
File metadata and controls
74 lines (56 loc) · 2.19 KB
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
ARG TOMCAT_VERSION=9.0.121
ARG TOMCAT_SHA256=d1a804502cddfd1c1436c1c37809ed4cb807a9c64a8a35fe1747d3ba9a0edeab
FROM eclipse-temurin:8-jdk AS builder
RUN apt-get update \
&& apt-get install --no-install-recommends -y git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usermgt
COPY app/pom.xml pom.xml
COPY app/mvnw mvnw
COPY app/.mvn .mvn
RUN ./mvnw dependency:go-offline -B
COPY app/ .
RUN ./mvnw package -DskipTests -B
FROM alpine:3.23 AS binaryConcentrator
ARG TOMCAT_VERSION
ARG TOMCAT_SHA256
RUN apk add --no-cache wget unzip
# Download and extract Tomcat
RUN wget -q -O /tmp/tomcat.tar.gz "http://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_VERSION%%.*}/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz" \
&& echo "${TOMCAT_SHA256} /tmp/tomcat.tar.gz" | sha256sum -c - \
&& mkdir -p /opt/apache-tomcat \
&& tar -xzf /tmp/tomcat.tar.gz -C /opt/apache-tomcat --strip-components=1 \
&& rm -rf /tmp/tomcat.tar.gz /opt/apache-tomcat/webapps/*
# Usermgt
WORKDIR /opt/apache-tomcat/webapps/usermgt
COPY --from=builder /usermgt/target/usermgt-*.war ./usermgt.war
RUN unzip usermgt.war \
&& rm usermgt.war \
&& chmod +x WEB-INF/cipher.sh
FROM registry.cloudogu.com/official/java:8.492.09-1
ARG TOMCAT_VERSION
LABEL NAME="official/usermgt" \
VERSION="1.23.1-1" \
maintainer="hello@cloudogu.com"
# mark as webapp for nginx
ENV SERVICE_TAGS=webapp \
# tomcat version
TOMCAT_VERSION=${TOMCAT_VERSION} \
# home of the app configuration
UNIVERSEADM_HOME=/var/lib/usermgt/conf2 \
TRUSTSTORE=/opt/apache-tomcat/truststore.jks \
CATALINA_SH=/opt/apache-tomcat/bin/catalina.sh \
STARTUP_DIR=/
# dependencies xmlstarlet and openldap-clients are required for givenname migration
RUN set -eux && \
apk update && apk upgrade && \
addgroup -S -g 1000 tomcat && \
adduser -S -h /opt/apache-tomcat -s /bin/bash -G tomcat -u 1000 tomcat && \
apk add --no-cache xmlstarlet openldap-clients && \
rm -rf /var/cache/apk/*
COPY --chown=1000:1000 --from=binaryConcentrator /opt/apache-tomcat /opt/apache-tomcat
COPY --chown=1000:1000 resources /
USER 1000:1000
EXPOSE 8080
HEALTHCHECK --interval=5s CMD doguctl healthy usermgt || exit 1
CMD /startup.sh