Skip to content

Commit e1ed2a9

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

File tree

86 files changed

+224
-6
lines changed

Some content is hidden

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

86 files changed

+224
-6
lines changed

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: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,71 @@
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+
# Disable Ansible (requires /dev/shm)
15+
ENV KPM_INSTALL_CMD /bin/true
16+
17+
# No JRuby plugin and no OSGI bundle, to keep memory usage low
18+
RUN kpm uninstall kpm --destination=$KILLBILL_INSTALL_DIR/bundles
19+
RUN rm -f $KILLBILL_INSTALL_DIR/bundles/platform/*
20+
21+
# Pre-expand the Kill Bill WAR
22+
RUN cd $TOMCAT_HOME/webapps && \
23+
mkdir ROOT && \
24+
cd ROOT && \
25+
jar -xvf ../ROOT.war && \
26+
touch -r ../ROOT.war META-INF/war-tracker && \
27+
cd - && \
28+
rm -f ROOT.war && \
29+
cd -
30+
31+
# TODO
32+
# * The SocketFactory jdbc driver doesn't seem to be working on Cloud Run
33+
# * The Logback Stackdriver LoggingAppender isn't reliable
34+
#
35+
# Custom libraries
36+
#COPY lib/*.jar $TOMCAT_HOME/webapps/ROOT/WEB-INF/lib/
37+
# Hack for now...
38+
#RUN cd $TOMCAT_HOME/webapps/ROOT/WEB-INF/lib/ && \
39+
# 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 && \
40+
# cd -
41+
42+
# Add Kaui
43+
COPY webapps/kaui.war $TOMCAT_HOME/webapps/kaui.war
44+
45+
# Pre-expand the Kaui WAR
46+
RUN cd $TOMCAT_HOME/webapps && \
47+
mkdir kaui && \
48+
cd kaui && \
49+
jar -xvf ../kaui.war && \
50+
touch -r ../kaui.war META-INF/war-tracker && \
51+
cd - && \
52+
rm -f kaui.war && \
53+
cd -
54+
55+
# TODO See above
56+
# Custom libraries
57+
#COPY lib/*.jar $TOMCAT_HOME/webapps/kaui/WEB-INF/lib/
58+
# Hack for now...
59+
#RUN cd $TOMCAT_HOME/webapps/kaui/WEB-INF/lib/ && \
60+
# 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 && \
61+
# cd -
62+
63+
# Note that classic configuration via environment variables won't work since Ansible isn't invoked
64+
COPY webapp-context.xml $TOMCAT_HOME/webapps/ROOT/META-INF/context.xml
65+
COPY webapp-context.xml $TOMCAT_HOME/webapps/kaui/META-INF/context.xml
66+
COPY context.xml $TOMCAT_HOME/conf/context.xml
67+
COPY server.xml $TOMCAT_HOME/conf/server.xml
68+
COPY setenv.sh $TOMCAT_HOME/bin/setenv.sh
69+
COPY logback.xml $KILLBILL_INSTALL_DIR/logback.xml
70+
COPY killbill.properties.template $KILLBILL_INSTALL_DIR/killbill.properties.template
71+
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">
3+
</Context>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
org.killbill.security.shiroNbHashIterations=1
2+
org.killbill.jaxrs.threads.pool.nb=5
3+
org.killbill.payment.plugin.threads.nb=1
4+
org.killbill.billing.osgi.bundles.jruby.conf.dir=/var/lib/killbill/config
5+
org.killbill.osgi.bundle.install.dir=/var/lib/killbill/bundles
6+
org.killbill.server.baseUrl=http://localhost:8080
7+
org.killbill.billing.osgi.dao.user=$KILLBILL_DAO_USER
8+
org.killbill.billing.osgi.dao.password=$KILLBILL_DAO_PASSWORD
9+
org.killbill.billing.osgi.dao.url=$KILLBILL_DAO_URL
10+
org.killbill.dao.user=$KILLBILL_DAO_USER
11+
org.killbill.dao.password=$KILLBILL_DAO_PASSWORD
12+
org.killbill.dao.url=$KILLBILL_DAO_URL
13+
org.killbill.dao.maxActive=10
14+
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)