diff --git a/xwiki-mysql-tomcat/Dockerfile b/xwiki-mysql-tomcat/Dockerfile index e82826bd069f564478f8634b7252817bef8a5bca..d40cff5934e28e616e909d19f7296e3ef89bf051 100644 --- a/xwiki-mysql-tomcat/Dockerfile +++ b/xwiki-mysql-tomcat/Dockerfile @@ -36,9 +36,14 @@ RUN echo "deb http://http.debian.net/debian jessie-backports main" > /etc/apt/so rm -rf /var/lib/apt/lists/* # Install XWiki as the ROOT webapp context in Tomcat +# Create the Tomcat temporary directory +# Configure the XWiki permanent directory RUN rm -rf /var/lib/tomcat8/webapps/* && \ + mkdir -p /var/lib/tomcat8/temp && \ + mkdir -p /var/lib/xwiki && \ curl -L "http://download.forge.ow2.org/xwiki/xwiki-enterprise-web-${XWIKI_VERSION}.war" -o xwiki.war && \ unzip -d /var/lib/tomcat8/webapps/ROOT xwiki.war && \ + chown -R tomcat8:tomcat8 /var/lib/tomcat8 /var/lib/xwiki && \ rm -f xwiki.war # Download the MySQL JDBC driver and install it in the XWiki webapp @@ -52,24 +57,14 @@ RUN curl -L https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java # Configure Tomcat. For example set the memory for the Tomcat JVM since the default value is too small for XWiki COPY tomcat/setenv.sh /usr/share/tomcat8/bin/ -# Create the Tomcat temporary directory -RUN mkdir -p /var/lib/tomcat8/temp - # Setup the XWiki Hibernate configuration COPY xwiki/hibernate.cfg.xml /var/lib/tomcat8/webapps/ROOT/WEB-INF/hibernate.cfg.xml -# Configure the XWiki permanent directory -RUN mkdir -p /var/lib/xwiki - # Set a specific distribution id in XWiki for this docker packaging. RUN sed "s/<id>org.xwiki.enterprise:xwiki-enterprise-web/<id>org.xwiki.enterprise:xwiki-enterprise-docker/" \ < /var/lib/tomcat8/webapps/ROOT/META-INF/extension.xed > /var/lib/tomcat8/webapps/ROOT/META-INF/extension2.xed && \ mv /var/lib/tomcat8/webapps/ROOT/META-INF/extension2.xed /var/lib/tomcat8/webapps/ROOT/META-INF/extension.xed -# Set ownership and permission to the tomcat8 user -RUN chown -R tomcat8:tomcat8 /var/lib/xwiki -RUN chown -R tomcat8:tomcat8 /var/lib/tomcat8 - # Add scripts required to make changes to XWiki configuration files at execution time COPY xwiki/xwiki-config-replace.sh /usr/local/bin/xwiki-config-replace.sh COPY xwiki/xwiki-set-cfg /usr/local/bin/xwiki-set-cfg