Skip to content

olpie101/molo-dockeriser

Repository files navigation

MOLO Dockeriser

A Dockerfile Genrator for setting up Molo mobi sites

Molo Dockeriser is a tool for creating Dockerfiles used to create docker containers for sites based on Molo.

The goal is to make the creation of Docker containers as easy as possible.

Setup

NB: The use of a virtual environment is highly recommended

pip install -e .

Ensure that you have Docker already installed and you are ready to go!!!


The dockeriser uses a the config.ini configuration file to generate the correct Dockerfile. The config file contains the following variables:

repo-url — location of the molo website repository. Providing a directory is currently not supported.

container-ports — ports which should be exposed in the docker container, each port separated by a comma (ie. 8000,8080). The first specified port number will be used as for the access url.

app-name — identifies the running application in the docker container

app-wsgi — reference to the wsgi used to start the application service

The config.ini is already setup with an example to help you get started.

Usage

To create the Dockerfile simply execute

python ./molo_dockerfile_generator.py

Create the docker image using

docker build -t molo-container .

Run the image using

docker run -it -p 8088:8000 molo-test #for interactive shell OR
docker run -d -p 8088:8000 molo-test #run in background

Ensure that the port number corresponds to the first port number provided in the the config file. This creates a port forwarding from your host machine on port 8088 to port 8000 on the docker container.

To view the application running in the container navigate to localhost:8088 in your browser. This will not work on Mac OS X.

For Mac OS X you need to navigate to the virtual machine's ip address. To find out what ip address to use use the following command:

docker-machine ls

This only works if you are using the more recent Docker Toolbox and not Boot2Docker. You should get an output similar to this:

NAME      ACTIVE   DRIVER       STATE     URL                         SWARM
default   -        virtualbox   Running   tcp://192.168.99.101:2376

Use the ip address which is displayed. Using the results from above, to view the application on OS X would require you to navigate to 192.168.99.101:8088.

About

script to create docker containers for molo sites

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published