My first try with DAB (aka Distributed Application Bundle)

Purpose

Docker 1.12 introduced the notion of Distributed Application Bundle. As a very happy user of Docker Compose , I was wondering how Compose and DAB were related. Will DAB replace Compose ? Does not seem so. In fact a DAB file can be created from a Compose file and then deployed on a cluster.
Let’s try to see how this is working.

Lire la suite

Deploy a multi services application with swarm mode

Purpose

In the previous article we saw how to deploy a service using the services api available in swarm mode. The setup of the initial swarm was done here.

The service deployed was a very basic Node.js application that returns the name of a random city of the world and the ip of the container handling the request. The only usage of this service was to test the services api.
We will now deployed a whole application made of several services as represented below.

demo application

Lire la suite

Create a swarm cluster with Docker 1.12 swarm mode

Swarm made easy

One of the biggest changes presented during DockerCon 2016 (gosh… I wish I was there) is the swarm mode of Engine 1.12. What does that mean ? That you can create a swarm cluster out of the box if you have the Docker daemon 1.12 running.

A command as simple as:

$ docker swarm init

is enough to create a Swarm. A Swarm with a single management node but still a Swarm.

Lire la suite

Example of CI/CD stack

Context

When I started to work at TRAXxs (we are doing some pretty cool stuff there btw 🙂 ), there was a lot of things to put in place to setup our back-end / front-end layers. The cool thing was the possibility to select the technologies we will use… Let’s go Docker, Node.js, Mongo + other cool stuff then (a little bit of Clojure + some Go, as they are languages that Im also very interested in).

At TRAXxs, we are working on connected insole devices. To keep it simple, on the server side (the part I’m in charge) we collect the data, make some analysis and expose it to the clients via api and web front-end. There is, obviously, much more than this but this is a cool summary.

Lire la suite

Improved Dockerfile for a Node.js application

A not so great Dockerfile

Not that long ago, when I needed to dockerize my Node.js application, I used a Dockerfile like the following one.


FROM node:4.4.5

# Copy src files
COPY . /app/

# Use /app working directory
WORKDIR /app

# Expose API port
EXPOSE 80

# Build dependencies
RUN npm install

# Run application
CMD ["npm", "start"]

Lire la suite