Scaffolding Strategies

This document describes the different possibilities to define the scaffolding of applications to be used with Dockership.

The easiest strategy to working with Dockership is to use self-contained repositiories: every repository to be deployed should contain his Dockerfile. Alternatively, the Dockefiles of the different applications of a company can be centralized in a single repository.

Self-contained Repositories

This is the simplest way to work with Dockership: Just place a Dockerfile at the root of your repository. (This is the default location, you can configure your own).

In this example we deploy an AngularJS tool using dockerfile/nginx, the container should retrieve the code through a git clone and execute all the required command to work properly.

FROM dockerfile/nginx

# pre requisites
RUN apt-get install -y npm nodejs
RUN ln -s /usr/bin/nodejs /usr/local/bin/node
RUN npm install -g bower grunt karma

# source code
RUN rm -rf /var/www
RUN git clone /var/www

# post code commands
WORKDIR /var/www
RUN npm install
RUN bower install --allow-root


# boot
CMD ["/usr/sbin/nginx"]

This project at the dockership.ini can be configured as follows:

[Project "corporate-site"]
Repository =
Port =
Environment = live

Centralised dockerfiles repository

Maybe you prefer keep all your company’s dockerfiles in the same repository, keeping away from the development team those files.

Based on this hypothetic scaffolding:

 |_ dokerfiles
     |_ CorporateSiteDokerFile
     |_ InternalSiteDockerfile

Our dockership.ini will looks like:

[Project "corporate-site"]
Repository =
RelatedRepository =
Dockerfile = dockerfiles/CorporateSiteDokerFile
Port =
Environment = live

[Project "internal-site"]
Repository =
RelatedRepository =
Dockerfile = dockerfiles/InternalSiteDockerfile
Port =
Environment = live

Using the RelatedRepository we can track any change at the deployed project, having the dockerfile in other repository. But we have a caveat, every time a file is changed at the devops repository even unrelated to the project, this project will look outdated.