Skip to content

Commit 7e9de44

Browse files
committed
docker: add light image
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
1 parent 211453e commit 7e9de44

85 files changed

Lines changed: 190 additions & 6 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ansible/templates/tomcat/conf/setenv.sh.j2

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ CATALINA_OPTS="-server
4040
{% endif %}
4141
-XX:SurvivorRatio={{ jvm_survivor_ratio }}
4242
-XX:+DisableExplicitGC
43+
{% if not lookup('env', 'TOMCAT_DISABLE_GC_LOGGING') %}
4344
-Xloggc:{{ catalina_base }}/logs/gc.log
4445
-XX:+PrintGCApplicationConcurrentTime
4546
-XX:+PrintGCApplicationStoppedTime
@@ -48,7 +49,9 @@ CATALINA_OPTS="-server
4849
-XX:+PrintTenuringDistribution
4950
-XX:+UseGCLogFileRotation
5051
-XX:NumberOfGCLogFiles=14
51-
-XX:GCLogFileSize=100M"
52+
-XX:GCLogFileSize=100M
53+
{% endif %}
54+
"
5255

5356
# Java Properties
5457
export CATALINA_OPTS="$CATALINA_OPTS
Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,45 @@
11
FROM killbill/killbill:0.20.11
22
MAINTAINER Kill Bill core team <killbilling-users@googlegroups.com>
33

4-
RUN kpm uninstall kpm --destination=/var/lib/killbill/bundles
4+
# Install envsubst (see killbill.sh)
5+
USER root
6+
ENV DEBIAN_FRONTEND noninteractive
7+
RUN apt-get update && \
8+
apt-get install -y \
9+
gettext-base && \
10+
rm -rf /var/lib/apt/lists/*
11+
ENV DEBIAN_FRONTEND teletype
12+
USER tomcat
513

6-
ENV TOMCAT_JAVA_XMS 1024m
7-
ENV TOMCAT_JAVA_XMX 1792m
8-
ENV TOMCAT_JAVA_NEW_SIZE 100m
9-
ENV TOMCAT_JAVA_MAX_NEW_SIZE 768m
14+
# Pre-expand the WAR
15+
RUN cd $TOMCAT_HOME/webapps && \
16+
mkdir ROOT && \
17+
cd ROOT && \
18+
jar -xvf ../ROOT.war && \
19+
touch -r ../ROOT.war META-INF/war-tracker && \
20+
cd - && \
21+
rm -f ROOT.war && \
22+
cd -
23+
24+
# Custom libraries
25+
COPY lib/*.jar $TOMCAT_HOME/webapps/ROOT/WEB-INF/lib/
26+
# Hack for now...
27+
RUN cd $TOMCAT_HOME/webapps && \
28+
rm -f animal-sniffer-annotations-1.14.jar annotations-3.0.1u2.jar asm-5.0.3.jar commons-codec-1.9.jar commons-lang3-3.2.1.jar error_prone_annotations-2.1.3.jar google-api-services-sqladmin-v1beta4-rev20190510-1.28.0.jar j2objc-annotations-1.1.jar jackson-core-2.9.6.jar && \
29+
cd -
30+
31+
# Disable Ansible (requires /dev/shm)
32+
ENV KPM_INSTALL_CMD /bin/true
33+
34+
# No JRuby plugin and no OSGI bundle, to keep memory usage low
35+
RUN kpm uninstall kpm --destination=$KILLBILL_INSTALL_DIR/bundles
36+
RUN rm -f $KILLBILL_INSTALL_DIR/bundles/platform/*
37+
38+
# Note that classic configuration via environment variables won't work since Ansible isn't invoked
39+
COPY context.xml $TOMCAT_HOME/conf/context.xml
40+
COPY server.xml $TOMCAT_HOME/conf/server.xml
41+
COPY setenv.sh $TOMCAT_HOME/bin/setenv.sh
42+
COPY webapp-context.xml $TOMCAT_HOME/webapps/ROOT/META-INF/context.xml
43+
COPY logback.xml $KILLBILL_INSTALL_DIR/logback.xml
44+
COPY killbill.properties.template $KILLBILL_INSTALL_DIR/killbill.properties.template
45+
COPY killbill.sh $KILLBILL_INSTALL_DIR
Lines changed: 6 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Context unloadDelay="31000" docBase="/var/lib/tomcat/webapps/">
3+
</Context>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
org.killbill.persistent.bus.external.inMemory=true
2+
org.killbill.persistent.bus.main.inMemory=true
3+
org.killbill.security.shiroNbHashIterations=1
4+
org.killbill.jaxrs.threads.pool.nb=5
5+
org.killbill.payment.plugin.threads.nb=1
6+
org.killbill.billing.osgi.bundles.jruby.conf.dir=/var/lib/killbill/config
7+
org.killbill.osgi.bundle.install.dir=/var/lib/killbill/bundles
8+
org.killbill.server.baseUrl=http://localhost:8080
9+
org.killbill.billing.osgi.dao.user=$KILLBILL_DAO_USER
10+
org.killbill.billing.osgi.dao.password=$KILLBILL_DAO_PASSWORD
11+
org.killbill.billing.osgi.dao.url=$KILLBILL_DAO_URL
12+
org.killbill.dao.user=$KILLBILL_DAO_USER
13+
org.killbill.dao.password=$KILLBILL_DAO_PASSWORD
14+
org.killbill.dao.url=$KILLBILL_DAO_URL
15+
org.killbill.dao.maxActive=10
16+
org.killbill.billing.osgi.dao.maxActive=10
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
export KILLBILL_DAO_USER=${KILLBILL_DAO_USER:-killbill}
4+
export KILLBILL_DAO_PASSWORD=${KILLBILL_DAO_PASSWORD:-killbill}
5+
export KILLBILL_DAO_URL=${KILLBILL_DAO_URL:-jdbc:h2:mem:killbill}
6+
7+
envsubst < $KILLBILL_INSTALL_DIR/killbill.properties.template > $KILLBILL_INSTALL_DIR/killbill.properties
8+
9+
exec /usr/share/tomcat/bin/catalina.sh run
Binary file not shown.
3.05 KB
Binary file not shown.
44 KB
Binary file not shown.
112 KB
Binary file not shown.

0 commit comments

Comments
 (0)