-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (42 loc) · 1.99 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
# Dockerizing eXo Platform Chat standalone:
#
# Build: docker build -t exoplatform/chat-server .
#
# Run: docker run -ti --rm --name=exo -p 80:8080 exoplatform/chat-server
# docker run -d --name=exo -p 80:8080 exoplatform/chat-server
# ----- build step 1
FROM exoplatform/jdk:21-ubuntu-2404 AS install
ARG CHAT_SERVER_VERSION=7.0.0-RC01
COPY download.sh /
RUN chmod u+x /download.sh && sync && /download.sh
# COPY install.sh /
# RUN chmod u+x /install.sh && /install.sh
RUN cd /usr/local && unzip /chatserver.zip && mv chat-server-standalone-${CHAT_SERVER_VERSION} chat-server
# ----- build step 2
FROM exoplatform/jdk:17-ubuntu-2004
LABEL maintainer="eXo Platform <docker@exoplatform.com>"
# Install the needed packages
RUN apt-get -qq update && \
apt-get -qq -y upgrade ${_APT_OPTIONS} && \
apt-get -qq -y install ${_APT_OPTIONS} xmlstarlet && \
apt-get -qq -y autoremove && \
apt-get -qq -y clean && \
rm -rf /var/lib/apt/lists/*
ENV CHAT_APP_DIR=/opt/chat-server
ENV CHAT_CONF_DIR=/etc/chat-server
ENV CHAT_LOG_DIR=/var/log/chat-server
ENV EXO_USER=exo
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
# (we use 999 as uid like in official Docker images)
RUN useradd --create-home -u 999 --user-group --shell /bin/bash ${EXO_USER}
COPY --chown=999 --from=install /usr/local/chat-server ${CHAT_APP_DIR}
COPY --chown=999 bin/setenv.sh ${CHAT_APP_DIR}/bin/setenv-customize.sh
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN chmod u+x ${CHAT_APP_DIR}/bin/setenv-customize.sh \
&& ln -s ${CHAT_APP_DIR}/conf ${CHAT_CONF_DIR} \
&& mkdir -p ${CHAT_LOG_DIR} && chown ${EXO_USER} ${CHAT_LOG_DIR} \
&& rm -rf ${CHAT_APP_DIR}/logs && ln -s ${CHAT_LOG_DIR} ${CHAT_APP_DIR}/logs
EXPOSE 8080
USER ${EXO_USER}
ENTRYPOINT ["/usr/local/bin/tini", "--"]
CMD [ "/opt/chat-server/start_chatServer.sh" ]