-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pierre-Alexandre Meyer <[email protected]>
- Loading branch information
Showing
85 changed files
with
190 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,45 @@ | ||
FROM killbill/killbill:0.20.11 | ||
MAINTAINER Kill Bill core team <[email protected]> | ||
|
||
RUN kpm uninstall kpm --destination=/var/lib/killbill/bundles | ||
# Install envsubst (see killbill.sh) | ||
USER root | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
gettext-base && \ | ||
rm -rf /var/lib/apt/lists/* | ||
ENV DEBIAN_FRONTEND teletype | ||
USER tomcat | ||
|
||
ENV TOMCAT_JAVA_XMS 1024m | ||
ENV TOMCAT_JAVA_XMX 1792m | ||
ENV TOMCAT_JAVA_NEW_SIZE 100m | ||
ENV TOMCAT_JAVA_MAX_NEW_SIZE 768m | ||
# Pre-expand the WAR | ||
RUN cd $TOMCAT_HOME/webapps && \ | ||
mkdir ROOT && \ | ||
cd ROOT && \ | ||
jar -xvf ../ROOT.war && \ | ||
touch -r ../ROOT.war META-INF/war-tracker && \ | ||
cd - && \ | ||
rm -f ROOT.war && \ | ||
cd - | ||
|
||
# Custom libraries | ||
COPY lib/*.jar $TOMCAT_HOME/webapps/ROOT/WEB-INF/lib/ | ||
# Hack for now... | ||
RUN cd $TOMCAT_HOME/webapps && \ | ||
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 && \ | ||
cd - | ||
|
||
# Disable Ansible (requires /dev/shm) | ||
ENV KPM_INSTALL_CMD /bin/true | ||
|
||
# No JRuby plugin and no OSGI bundle, to keep memory usage low | ||
RUN kpm uninstall kpm --destination=$KILLBILL_INSTALL_DIR/bundles | ||
RUN rm -f $KILLBILL_INSTALL_DIR/bundles/platform/* | ||
|
||
# Note that classic configuration via environment variables won't work since Ansible isn't invoked | ||
COPY context.xml $TOMCAT_HOME/conf/context.xml | ||
COPY server.xml $TOMCAT_HOME/conf/server.xml | ||
COPY setenv.sh $TOMCAT_HOME/bin/setenv.sh | ||
COPY webapp-context.xml $TOMCAT_HOME/webapps/ROOT/META-INF/context.xml | ||
COPY logback.xml $KILLBILL_INSTALL_DIR/logback.xml | ||
COPY killbill.properties.template $KILLBILL_INSTALL_DIR/killbill.properties.template | ||
COPY killbill.sh $KILLBILL_INSTALL_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Kill Bill light | ||
|
||
Kill Bill light is suitable for serverless deployments such as Google Cloud Run: | ||
|
||
* Memory usage low | ||
* No `/dev/shm` requirement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Context unloadDelay="31000" docBase="/var/lib/tomcat/webapps/"> | ||
</Context> |
16 changes: 16 additions & 0 deletions
16
docker/templates/killbill/light/killbill.properties.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
org.killbill.persistent.bus.external.inMemory=true | ||
org.killbill.persistent.bus.main.inMemory=true | ||
org.killbill.security.shiroNbHashIterations=1 | ||
org.killbill.jaxrs.threads.pool.nb=5 | ||
org.killbill.payment.plugin.threads.nb=1 | ||
org.killbill.billing.osgi.bundles.jruby.conf.dir=/var/lib/killbill/config | ||
org.killbill.osgi.bundle.install.dir=/var/lib/killbill/bundles | ||
org.killbill.server.baseUrl=http://localhost:8080 | ||
org.killbill.billing.osgi.dao.user=$KILLBILL_DAO_USER | ||
org.killbill.billing.osgi.dao.password=$KILLBILL_DAO_PASSWORD | ||
org.killbill.billing.osgi.dao.url=$KILLBILL_DAO_URL | ||
org.killbill.dao.user=$KILLBILL_DAO_USER | ||
org.killbill.dao.password=$KILLBILL_DAO_PASSWORD | ||
org.killbill.dao.url=$KILLBILL_DAO_URL | ||
org.killbill.dao.maxActive=10 | ||
org.killbill.billing.osgi.dao.maxActive=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
export KILLBILL_DAO_USER=${KILLBILL_DAO_USER:-killbill} | ||
export KILLBILL_DAO_PASSWORD=${KILLBILL_DAO_PASSWORD:-killbill} | ||
export KILLBILL_DAO_URL=${KILLBILL_DAO_URL:-jdbc:h2:mem:killbill} | ||
|
||
envsubst < $KILLBILL_INSTALL_DIR/killbill.properties.template > $KILLBILL_INSTALL_DIR/killbill.properties | ||
|
||
exec /usr/share/tomcat/bin/catalina.sh run |
Binary file added
BIN
+3.37 KB
docker/templates/killbill/light/lib/animal-sniffer-annotations-1.17.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mvn dependency:copy-dependencies -DoutputDirectory=. |
Binary file added
BIN
+12.9 KB
docker/templates/killbill/light/lib/error_prone_annotations-2.3.2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+170 KB
.../templates/killbill/light/lib/google-api-services-sqladmin-v1beta4-rev20190510-1.28.0.jar
Binary file not shown.
Binary file added
BIN
+170 KB
.../templates/killbill/light/lib/google-api-services-sqladmin-v1beta4-rev20190607-1.30.1.jar
Binary file not shown.
Binary file added
BIN
+5.53 KB
docker/templates/killbill/light/lib/google-auth-library-credentials-0.17.1.jar
Binary file not shown.
Binary file added
BIN
+101 KB
docker/templates/killbill/light/lib/google-auth-library-oauth2-http-0.17.0.jar
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+10.1 KB
docker/templates/killbill/light/lib/google-cloud-core-grpc-1.88.0.jar
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+8.4 KB
docker/templates/killbill/light/lib/google-cloud-logging-logback-0.106.0-alpha.jar
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+10.2 KB
docker/templates/killbill/light/lib/google-http-client-apache-2.0.0.jar
Binary file not shown.
Binary file added
BIN
+8.35 KB
docker/templates/killbill/light/lib/google-http-client-jackson2-1.28.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+21.5 KB
docker/templates/killbill/light/lib/jdbc-socket-factory-core-1.0.14.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+2.15 KB
...mplates/killbill/light/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.44 KB
docker/templates/killbill/light/lib/mysql-socket-factory-connector-j-8-1.0.14.jar
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+14.6 KB
docker/templates/killbill/light/lib/opencensus-contrib-grpc-metrics-0.21.0.jar
Binary file not shown.
Binary file added
BIN
+18.3 KB
docker/templates/killbill/light/lib/opencensus-contrib-http-util-0.18.0.jar
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.kill-bill.docker</groupId> | ||
<artifactId>killbill-light</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.cloud.sql</groupId> | ||
<artifactId>mysql-socket-factory-connector-j-8</artifactId> | ||
<version>1.0.14</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>google-cloud-logging-logback</artifactId> | ||
<version>0.106.0-alpha</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Binary file added
BIN
+513 KB
docker/templates/killbill/light/lib/proto-google-cloud-logging-v2-0.71.0.jar
Binary file not shown.
Binary file added
BIN
+1.29 MB
docker/templates/killbill/light/lib/proto-google-common-protos-1.16.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<configuration scan="false"> | ||
<appender name="CLOUD" class="com.google.cloud.logging.logback.LoggingAppender"> | ||
<log>killbill.log</log> | ||
<flushLevel>WARN</flushLevel> | ||
</appender> | ||
|
||
<!-- Silence verbose loggers --> | ||
<logger name="com.dmurph" level="OFF"/> | ||
<logger name="jdbc" level="OFF"/> | ||
<logger name="org.jooq.Constants" level="OFF"/> | ||
<logger name="org.eclipse" level="WARN"/> | ||
<logger name="org.killbill.commons.jdbi.guice.DBIProvider" level="OFF"/> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="CLOUD" /> | ||
</root> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<Server port="8005" shutdown="SHUTDOWN"> | ||
<Listener className="org.apache.catalina.startup.VersionLoggerListener" /> | ||
<!-- APR library loader. Documentation at /docs/apr.html --> | ||
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> | ||
<!-- Prevent memory leaks due to use of particular java/javax APIs--> | ||
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> | ||
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> | ||
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> | ||
|
||
<Service name="Catalina"> | ||
<Executor name="tomcatThreadPool" | ||
namePrefix="catalina-exec-" | ||
maxThreads="20" | ||
maxIdleTime="30000" | ||
minSpareThreads="4" | ||
prestartminSpareThreads="true" /> | ||
|
||
<Connector executor="tomcatThreadPool" | ||
port="8080" | ||
protocol="HTTP/1.1" | ||
connectionTimeout="20000" /> | ||
|
||
<Engine name="Catalina" defaultHost="localhost"> | ||
<Host name="localhost" | ||
appBase="webapps" | ||
unpackWARs="true" | ||
autoDeploy="false"> | ||
|
||
<Valve className="org.apache.catalina.valves.RemoteIpValve" | ||
protocolHeader="x-forwarded-proto" | ||
portHeader="x-forwarded-port" /> | ||
</Host> | ||
</Engine> | ||
</Service> | ||
</Server> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export JAVA_HOME=${JAVA_HOME-"/usr/lib/jvm/default-java"} | ||
|
||
# JVM Options | ||
CATALINA_OPTS="-server | ||
-showversion | ||
-XX:+PrintCommandLineFlags | ||
-XX:+UseCodeCacheFlushing | ||
-Xms512m | ||
-Xmx1024m | ||
-XX:+CMSClassUnloadingEnabled | ||
-XX:-OmitStackTraceInFastThrow | ||
-XX:+UseParNewGC | ||
-XX:+UseConcMarkSweepGC | ||
-XX:+CMSConcurrentMTEnabled | ||
-XX:+ScavengeBeforeFullGC | ||
-XX:+CMSScavengeBeforeRemark | ||
-XX:+CMSParallelRemarkEnabled | ||
-XX:+UseCMSInitiatingOccupancyOnly | ||
-XX:CMSInitiatingOccupancyFraction=50 | ||
-XX:NewSize=100m | ||
-XX:MaxNewSize=256m | ||
-XX:SurvivorRatio=10 | ||
-XX:+DisableExplicitGC" | ||
|
||
# Java Properties | ||
export CATALINA_OPTS="$CATALINA_OPTS | ||
-Dlogback.configurationFile=/var/lib/killbill/logback.xml | ||
-Dorg.killbill.server.properties=file:///var/lib/killbill/killbill.properties | ||
-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true | ||
-Djava.rmi.server.hostname=$ENV_HOST_IP | ||
-Djava.security.egd=file:/dev/./urandom | ||
-Djruby.compile.invokedynamic=false | ||
-Dlog4jdbc.sqltiming.error.threshold=1000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Context> | ||
<JarScanner> | ||
<JarScanFilter pluggabilitySkip="*" tldSkip="*" defaultTldScan="false" /> | ||
</JarScanner> | ||
</Context> |