Archives | Categories

A Docker Image for Moochine Demo

Table of Contents

<2014-08-10 Sun>

1 Moochine and Moochine-Demo

Moochine is a simple web framework based on Openresty I created. And moochine-demo(https://github.com/appwilldev/moochine-demo) is a simple moochine app to demonstrate how to use the framework. You can also use it as a scratch to start your own moochine app. For the newbies, it seems terrible to setup such a complicated environment, eventually it's not. Anyhow, I created a Docker image with that demo running on for them.

2 The Docker Image

The image is taged with "sid-moochine" on https://registry.hub.docker.com/u/kdr2/debian/, you can get it easily:

docker pull kdr2/debian:sid-moochine

And then start the demo:

docker run -d -p 0.0.0.0:9801:9800 kdr2/debian:sid-moochine /root/moochine-demo/bin/start.sh -f

The option -f for start.sh tells Nginx(openresty) to run at foregroud, so the Docker container will be running on. We also map the port with option -p 0.0.0.0:9801:9800 for Docker, so you can visit http://localhost:9801/ltp on the host OS to see if your demo is running well.

But, there's no database(redis, pgsql, mysql) installed in this image, you should install them yourself if you want to use them. It's simple:

  • run the image and start a shell:

    $ docker run -t -i -p 0.0.0.0:9801:9800 kdr2/debian:sid-moochine /bin/bash
    
  • install what you want (using aptitude) and start them in that shell;
  • start the demo:

    root@4df89d75e286:/# /root/moochine-demo/bin/start.sh
    

You can also let the demo connect the database on your host OS: just change their server address in the code.

3 Discuss and Comment

comments powered by Disqus

Copyright © KDr2, SOME RIGHTS RESERVED UNDER CC BY-NC 4.0.

Built with Emacs 25.1.50.1 (Org mode 8.3.5).

Last updated: 2016-08-18 Thu 14:04.

Green Web Hosting! This site hosted by DreamHost.