first shot

This commit is contained in:
DigitalLumberjack
2016-03-02 23:40:03 +01:00
parent ffb68c3596
commit cbab40e5d3
3 changed files with 50 additions and 0 deletions

10
Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM jetty:9.3.7-jre8
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/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/ROOT/WEB-INF/
CMD ["/usr/local/bin/start.sh"]

31
config/hibernate.cfg.xml Normal file
View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="jdbc.use_scrollable_resultset">false</property>
<property name="dbcp.defaultAutoCommit">false</property>
<property name="dbcp.maxTotal">50</property>
<property name="dbcp.maxIdle">5</property>
<property name="dbcp.maxWaitMillis">30000</property>
<property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
<property name="connection.url">jdbc:mysql://MYSQL_HOST/xwiki</property>
<property name="connection.username">MYSQL_USER</property>
<property name="connection.password">MYSQL_PASSWORD</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property name="dbcp.poolPreparedStatements">true</property>
<property name="dbcp.maxOpenPreparedStatements">20</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>
</session-factory>
</hibernate-configuration>

9
start.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/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/ROOT/WEB-INF/hibernate.cfg.xml
sed -i "s|MYSQL_USER|${MYSQL_USER}|" ${JETTY_BASE}/webapps/ROOT/WEB-INF/hibernate.cfg.xml
sed -i "s|MYSQL_PASSWORD|${MYSQL_PASSWORD}|" ${JETTY_BASE}/webapps/ROOT/WEB-INF/hibernate.cfg.xml
java -jar "$JETTY_HOME/start.jar"