node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »

The worker

The worker receives a message, starts a (using the Dockerized version), uploads the result to S3 and sends status and end finished messages on a message queue.

Running this on the live site runs Docker in Docker (DiD) scoring 100 points in Docker coolness :)

Before starting a worker, make sure you have exported your environment variables.

Running Docker version

Since we are running DiD we need to start with the privileged parameter. Each worker also have their own start script where we export the environment config and start the service. Starting a worker needs to arguments: The name of the queue for inbound messages and the full path to the directory where the files will be stored.

Starting a worker listenting on the queue nyc, placing the data in the sitespeedio folder inside the container (

export NODE_ENV=production
export REDIS_HOST=****
export REDIS_QUEUES=****
export REDIS_PASSWORD=****
export S3_ACCESS_KEY_ID=****
export S3_SECRET_ACCESS_KEY=**** nyc /home/root/sitespeedio/

And start the container:

docker run --privileged --restart="always" --name worker -v /tmp:/var/log/ -v /root/ -d soulgalore/