Enterprise Installation with Docker

The easiest and recommended way to install and run one or multiple SwiftyBeaver Enterprise servers is via Docker.

Our Dockerfile uses Alpine which is a reduced Linux version with a low memory footprint and size. The Dockerfile is downloading during image building the latest version of the SwiftyBeaver Enterprise server binary. 

Existing images should be deleted every time a new SwiftyBeaver Enterprise version is released to avoid caching issues. 

1. Download & Build Image

# 1. Download Dockerfile
cd /tmp
curl -L https://lodge.swiftybeaver.com/dl/Dockerfile -o Dockerfile

# 2. Remove old image if existing
docker rmi sbenterprise

# 3. Build Image from Dockerfile
docker build -t sbenterprise .

# 4. Check if the new image is existing
docker images sbenterprise

The image is now existing on your host and can be used to create and run a new container.

2. Run Debug Container with Logging Output

The following listing creates a new Docker container in a non-daemonized mode. That makes it easier to read the start messages of SwiftyBeaver Enterprise to spot any issues. The container is automatically deleted on stop via the parameter   --rm.

You can set the required environment variables directly with the container creation call:

# 1. create & run container
docker run --rm -ti -p 8080:8080 --link elastic:elastic-url \
   -e APPS='app1|secret1|key1,app2|secret2|key2' \
   -e LICENSE='' \
   -e ES_HOST='http://YourElasticSearchHost:9200' \
   -e ES_AUTH_USER='elastic' \
   -e ES_AUTH_PASSWORD='changeme' \
   --name sbenterprise sbenterprise

# 2. Open a new Terminal window and check the container status
docker ps -f name=sbenterprise

# 3. Stop & delete the container
docker stop sbenterprise

To run the Docker container as daemon just add the parameter -d to the call.

3. Test Container Response

From the host you can connect to the running container to see if it works properly:

# Unprotected ping connection to see if server is running
curl "http://localhost:8080/ping"

# Basic Auth protected call to the server using app credentials
curl "http://localhost:8080/api/status" -u 'app1:secret1'

To make your SwiftyBeaver Enterprise server production-ready please read the setup instructions for a high availability setup behind a load balancer next.

Still need help? Contact Us Contact Us