[Updated] Having fun with Docker, Stripe and Kill Bill

[Updated] Having fun with Docker, Stripe and Kill Bill

One of our most popular blog posts is Having fun with Docker, Stripe and Kill Bill, where we showed how easy it is to leverage the powerful subscription engine offered by Kill Bill while delegating payments to Stripe. A lot has happened over the past 18 months: tools like docker-machine and docker-compose have become better and recent releases of Kill Bill have removed the need to edit various configuration files post-installation. Let’s take a look at how simpler the installation process has become. I assume you already have Docker installed and created a Stripe account. The first step is to create a machine to run your containers. On a mac, you would typically use the virtualbox driver: docker-machine create -d virtualbox killbill eval $(docker-machine env killbill) Note that to deploy Kill Bill to the cloud, the steps are similar (simply replace the driver with your provider’s, such as Microsoft Azure for example). Next, create a docker-compose file similar to the one below: and run: docker-compose up 3 containers will start: one for MariaDB (shared database), one for Kill Bill itself and one for Kaui (Kill Bill admin UI). You can then explore Kill Bill APIs by going to http://192.168.99.100:8080/api.html or log-in to Kaui by going to http://192.168.99.100:9090 (username: admin, password: password) to create your tenant. Note: make sure to replace 192.168.99.100 with the IP of your machine which you can retrieve via docker-machine ip killbill The final step is to configure your Stripe credentials. Create a configuration file stripe.yml: :stripe: :api_secret_key: 'sk_test_aaaabbbbccccdddd' and upload it via Kaui at http://192.168.99.100:9090/admin_tenants/1:     That’s it! To test your installation, you can run our sample Sinatra app,...
Having fun with Docker, Stripe and Kill Bill

Having fun with Docker, Stripe and Kill Bill

Note! An updated version of this tutorial can be found here.   Kill Bill has been dockerized! In this post, I’m going to show you how to get started with your own Kill Bill installation, integrated with Stripe, running on Docker.   Setup Start by installing Docker if you don’t have it yet. You will also need a Stripe api key. To get one: Create a free account at Stripe.com Go to your API Key Settings Write down the Test Secret Key   Deep dive into the Kill Bill container Our Docker image is based off the ubuntu:14.04 one. It comes with Tomcat and KPM (the Kill Bill package manager). Kill Bill is not yet present in the image: it is the role of KPM to fetch the Kill Bill war and its plugins. The first time the container is started, KPM will look at its configuration file (/etc/killbill/kpm.yml) and lay down the bits accordingly. The reason for this deferred step is to let you customize the image if you want to (Kill Bill version, plugins, etc.). You can start Kill Bill by running: docker run -tid --name killbilltest -p 8080:8080 killbill/killbill --name killbilltest assigns a name to the container, to be able to reference it easily later on -p 8080:8080 exports the port from the container, to access it from the host Here are some useful commands: docker logs -f killbilltest to tail the Kill Bill logs docker exec -ti killbilltest /bin/bash to log-in to the container docker exec -ti killbilltest cat /etc/killbill/killbill.properties to explore the Kill Bill configuration docker exec -ti killbilltest cat /etc/killbill/kpm.yml to explore the KPM...