Skip to content

Commit

Permalink
Fix for the feature that sets the catalina properties like memory usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen Bleul committed Aug 21, 2017
1 parent f80ffa3 commit 03e410d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ LABEL com.blacklabelops.application.confluence.version=$CONFLUENCE_VERSION \
EXPOSE 8090 8091

USER confluence
VOLUME ["${CONF_HOME}"]
VOLUME ["/var/atlassian/confluence"]
# Set the default working directory as the Confluence home directory.
WORKDIR ${CONF_HOME}
COPY docker-entrypoint.sh ${CONF_SCRIPT_HOME}/docker-entrypoint.sh
COPY docker-entrypoint.sh /home/confluence/docker-entrypoint.sh
ENTRYPOINT ["/sbin/tini","--","/home/confluence/docker-entrypoint.sh"]
CMD ["confluence"]
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Dockerized Atlassian Confluence

[![Open Issues](https://img.shields.io/github/issues/blacklabelops/confluence.svg)](https://github.com/blacklabelops/confluence/issues) [![Stars on GitHub](https://img.shields.io/github/stars/blacklabelops/confluence.svg)](https://github.com/cblacklabelops/confluence/stargazers)
[![Docker Stars](https://img.shields.io/docker/stars/blacklabelops/confluence.svg)](https://hub.docker.com/r/blacklabelops/confluence/) [![Docker Pulls](https://img.shields.io/docker/pulls/blacklabelops/confluence.svg)](https://hub.docker.com/r/blacklabelops/confluence/)

"One place for all your team's work - Spend less time hunting things down and more time making things happen. Organize your work, create documents, and discuss everything in one place." - [[Source](https://www.atlassian.com/software/confluence)]
Expand All @@ -23,7 +24,7 @@ You may also like:
# Make It Short

~~~~
$ docker run -d -p 80:8090 -p 8091:8091 --name confluence blacklabelops/confluence
$ docker run -d -p 80:8090 --name confluence blacklabelops/confluence
~~~~

# Setup
Expand Down Expand Up @@ -439,7 +440,7 @@ $ docker run -d -p 80:8090 \
-e "CATALINA_PARAMETER_VALUE2=1024m" \
-e "CATALINA_PARAMETER3=-Xmx" \
-e "CATALINA_PARAMETER_VALUE3=1024m" \
blacklabelops/confluence:development
blacklabelops/confluence
~~~~

> Sets the synchrony proxy and memory settings.
Expand Down
34 changes: 21 additions & 13 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ CATALINA_OPTS="-Datlassian.plugins.enable.wait=300 ${CATALINA_OPTS}"
CATALINA_OPTS="-Xms1024m ${CATALINA_OPTS}"
CATALINA_OPTS="-Xmx1024m ${CATALINA_OPTS}"
CATALINA_OPTS="-XX:+UseG1GC ${CATALINA_OPTS}"
CATALINA_OPTS="${START_CONFLUENCE_JAVA_OPTS} ${CATALINA_OPTS}"
CATALINA_OPTS="-Dsynchrony.enable.xhr.fallback=true ${CATALINA_OPTS}"
CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 ${CATALINA_OPTS}"
CATALINA_OPTS="-Dconfluence.context.path=${CONFLUENCE_CONTEXT_PATH} ${CATALINA_OPTS}"' >> ${CONF_INSTALL}/bin/setenv.sh
echo "export CATALINA_OPTS" >> ${CONF_INSTALL}/bin/setenv.sh
Expand All @@ -133,18 +135,22 @@ function setCatalinaConfigurationProperty() {
}

function processCatalinaConfigurationSettings() {
if [ -f "${CONF_INSTALL}/bin/setenv.sh" ]; then
sed -i "/export CATALINA_OPTS/d" ${CONF_INSTALL}/bin/setenv.sh
for (( i=1; ; i++ ))
do
VAR_CATALINA_PARAMETER="CATALINA_PARAMETER$i"
VAR_CATALINA_PARAMETER_VALUE="CATALINA_PARAMETER_VALUE$i"
if [ ! -n "${!VAR_CATALINA_PARAMETER}" ]; then
break
fi
setCatalinaConfigurationProperty ${!VAR_CATALINA_PARAMETER} ${!VAR_CATALINA_PARAMETER_VALUE}
done
echo "export CATALINA_OPTS" >> ${CONF_INSTALL}/bin/setenv.sh
VAR_CATALINA_PARAMETER="CATALINA_PARAMETER$i"
VAR_CATALINA_PARAMETER_VALUE="CATALINA_PARAMETER_VALUE$i"
if [ ! -n "${!VAR_CATALINA_PARAMETER}" ]; then
if [ -f "${CONF_INSTALL}/bin/setenv.sh" ]; then
sed -i "/export CATALINA_OPTS/d" ${CONF_INSTALL}/bin/setenv.sh
for (( i=1; ; i++ ))
do
VAR_CATALINA_PARAMETER="CATALINA_PARAMETER$i"
VAR_CATALINA_PARAMETER_VALUE="CATALINA_PARAMETER_VALUE$i"
if [ ! -n "${!VAR_CATALINA_PARAMETER}" ]; then
break
fi
setCatalinaConfigurationProperty ${!VAR_CATALINA_PARAMETER} ${!VAR_CATALINA_PARAMETER_VALUE}
done
echo "export CATALINA_OPTS" >> ${CONF_INSTALL}/bin/setenv.sh
fi
fi
}

Expand All @@ -162,7 +168,9 @@ processConfluenceConfigurationSettings

processCatalinaDefaultConfiguration

processCatalinaConfigurationSettings
if [ -n "${CATALINA_PARAMETER1}" ]; then
processCatalinaConfigurationSettings
fi

if [ -n "${CONFLUENCE_LOGFILE_LOCATION}" ]; then
processConfluenceLogfileSettings
Expand Down

0 comments on commit 03e410d

Please sign in to comment.