forked from camunda/camunda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (42 loc) · 1.59 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
ARG APP_ENV=prod
# Building builder image
FROM alpine:latest as builder
ARG DISTBALL
ENV TMP_ARCHIVE=/tmp/zeebe.tar.gz \
TMP_DIR=/tmp/zeebe \
TINI_VERSION=v0.19.0
COPY ${DISTBALL} ${TMP_ARCHIVE}
RUN mkdir -p ${TMP_DIR} && \
tar xfvz ${TMP_ARCHIVE} --strip 1 -C ${TMP_DIR} && \
# already create volume dir to later have correct rights
mkdir ${TMP_DIR}/data
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini ${TMP_DIR}/bin/tini
COPY docker/utils/startup.sh ${TMP_DIR}/bin/startup.sh
RUN chmod +x -R ${TMP_DIR}/bin/
RUN chmod 0775 ${TMP_DIR} ${TMP_DIR}/data
# Building prod image
FROM openjdk:11-jre-slim as prod
RUN echo "running PROD pre-install commands"
# Building dev image
FROM openjdk:11 as dev
RUN echo "running DEV pre-install commands"
RUN apt-get update
RUN wget -O - https://github.com/jvm-profiling-tools/async-profiler/releases/download/v1.7.1/async-profiler-1.7.1-linux-x64.tar.gz | tar xzv
# Building application image
FROM ${APP_ENV} as app
ENV ZB_HOME=/usr/local/zeebe \
ZEEBE_LOG_LEVEL=info \
ZEEBE_BROKER_GATEWAY_NETWORK_HOST=0.0.0.0 \
ZEEBE_STANDALONE_GATEWAY=false
ENV PATH "${ZB_HOME}/bin:${PATH}"
WORKDIR ${ZB_HOME}
EXPOSE 26500 26501 26502
VOLUME ${ZB_HOME}/data
RUN groupadd -g 1000 zeebe && \
adduser -u 1000 zeebe --system --ingroup zeebe && \
chmod g=u /etc/passwd && \
chown 1000:0 ${ZB_HOME} && \
chmod 0775 ${ZB_HOME}
COPY --from=builder --chown=1000:0 /tmp/zeebe/bin/startup.sh /usr/local/bin/startup.sh
COPY --from=builder --chown=1000:0 /tmp/zeebe ${ZB_HOME}
ENTRYPOINT ["tini", "--", "/usr/local/bin/startup.sh"]