fixed context

This commit is contained in:
DigitalLumberjack
2016-03-03 23:28:13 +01:00
parent e0af61c2eb
commit 11d7d28e12
2 changed files with 14 additions and 7 deletions

View File

@@ -3,12 +3,14 @@ FROM jetty:9.3.7-jre8
ENV MYSQL_USER xwiki
ENV MYSQL_PASSWORD dbpass
ENV MYSQL_HOST db
ENV WIKI_CONTEXT xwiki
RUN curl http://download.forge.ow2.org/xwiki/xwiki-enterprise-web-8.0-milestone-2.war --output ${JETTY_BASE}/xwiki8.war
RUN curl http://download.forge.ow2.org/xwiki/xwiki-enterprise-ui-mainwiki-all-8.0-milestone-2.xar --output ${JETTY_BASE}/xwiki8.xar
RUN unzip ${JETTY_BASE}/xwiki8.war -d ${JETTY_BASE}/webapps/${WIKI_CONTEXT}/
RUN curl http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar --output ${JETTY_BASE}/webapps/${WIKI_CONTEXT}/WEB-INF/lib/mysql-connector-java-5.jar
RUN mkdir -p ${JETTY_BASE}/webapps/ROOT/
RUN unzip ${JETTY_BASE}/xwiki8.war -d ${JETTY_BASE}/webapps/ROOT/
RUN curl http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar --output ${JETTY_BASE}/webapps/ROOT/WEB-INF/lib/mysql-connector-java-5.jar
ADD ./start.sh /usr/local/bin/start.sh
ADD ./config/hibernate.cfg.xml ${JETTY_BASE}/webapps/${WIKI_CONTEXT}/WEB-INF/
ADD ./config/hibernate.cfg.xml ${JETTY_BASE}/webapps/ROOT/WEB-INF/
CMD ["/usr/local/bin/start.sh"]

View File

@@ -1,9 +1,14 @@
#!/bin/bash
#curl http://download.forge.ow2.org/xwiki/xwiki-enterprise-web-8.0-milestone-2.war --output webapps/xwiki8.war
sed -i "s|MYSQL_HOST|${MYSQL_HOST}|" ${JETTY_BASE}/webapps/${WIKI_CONTEXT}/WEB-INF/hibernate.cfg.xml
sed -i "s|MYSQL_USER|${MYSQL_USER}|" ${JETTY_BASE}/webapps/${WIKI_CONTEXT}/WEB-INF/hibernate.cfg.xml
sed -i "s|MYSQL_PASSWORD|${MYSQL_PASSWORD}|" ${JETTY_BASE}/webapps/${WIKI_CONTEXT}/WEB-INF/hibernate.cfg.xml
if [ "$WIKI_CONTEXT" == "xwiki" ];then
if [ ! -f "${JETTY_BASE}/webapps/${WIKI_CONTEXT}" ];then
mv ${JETTY_BASE}/webapps/ROOT ${JETTY_BASE}/webapps/${WIKI_CONTEXT}
#curl http://download.forge.ow2.org/xwiki/xwiki-enterprise-web-8.0-milestone-2.war --output webapps/xwiki8.war
sed -i "s|MYSQL_HOST|${MYSQL_HOST}|" ${JETTY_BASE}/webapps/${WIKI_CONTEXT}/WEB-INF/hibernate.cfg.xml
sed -i "s|MYSQL_USER|${MYSQL_USER}|" ${JETTY_BASE}/webapps/${WIKI_CONTEXT}/WEB-INF/hibernate.cfg.xml
sed -i "s|MYSQL_PASSWORD|${MYSQL_PASSWORD}|" ${JETTY_BASE}/webapps/${WIKI_CONTEXT}/WEB-INF/hibernate.cfg.xml
fi
fi
java -jar "$JETTY_HOME/start.jar"