-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (43 loc) · 1.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
# Docker image of the powerauth cloud application
FROM ibm-semeru-runtimes:open-21.0.2_13-jre
LABEL maintainer="Lubos Racansky <[email protected]>"
# Prepare environment variables
ENV JAVA_HOME=/opt/java/openjdk \
LB_HOME=/usr/local/liquibase \
LB_VERSION=4.30.0 \
PKG_RELEASE=1~jammy \
LOGBACK_CONF=/opt/logback/conf \
TZ=UTC
ENV PATH=$PATH:$LB_HOME
# Upgrade OS and dependencies
RUN apt-get -y update \
&& apt-get -y upgrade \
&& apt-get -y install bash wget \
# Install Liquibase, inspired by https://github.com/mobtitude/liquibase/blob/master/Dockerfile
&& set -x \
&& wget -q -O /tmp/liquibase.tar.gz "https://github.com/liquibase/liquibase/releases/download/v$LB_VERSION/liquibase-$LB_VERSION.tar.gz" \
&& echo "184ffd609518091da42d6cd75e883b4f6ff1763cce8883e95fc99f7f05ca262d /tmp/liquibase.tar.gz" | sha256sum -c - \
&& mkdir -p "$LB_HOME" \
&& tar -xzf /tmp/liquibase.tar.gz -C "$LB_HOME" \
&& rm -rf "$LB_HOME/sdk" "$LB_HOME/examples" \
# Uninstall packages which are no longer needed and clean apt caches
&& apt-get -y remove wget gettext-base \
&& apt-get -y purge --auto-remove \
&& rm -rf /tmp/* /var/cache/apt/* \
# Remove default Liquibase data
&& rm -rf $LB_HOME/data \
# Add PowerAuth user
&& groupadd -r powerauth && useradd -r -g powerauth -s /sbin/nologin powerauth
# Copy new Liquibase data
COPY docs/db/changelog $LB_HOME/db/changelog
# Deploy and run applications
COPY user-data-store-server/target/user-data-store.war user-data-store.war
# Docker configuration
EXPOSE 8080
STOPSIGNAL SIGQUIT
# Add PowerAuth User
USER powerauth
COPY deploy/conf/logback/* $LOGBACK_CONF/
# Define entry point with mandatory commands (nginx)
COPY deploy/docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]