Giter Club home page Giter Club logo

keystoner's Introduction

[Keyston]e-Dock[er]

Introduction

The Keystoner repository contains a sample KeystoneJS application, and supporting files for dockerizing it.

Getting Started

Requirements

The docker-compose files were tested against a system running Mac OS X (10.11.3), with the Docker Toolbox.

KeystoneJS requires:

  1. Yeoman (yo)
  2. MongoDB

Buiding the Images and Running the app

From Scratch (Build Your Own Images)

$ git clone [email protected]:robertoriv/keystoner.git keystoner
$ cd keystoner
$ docker-compose -f docker-compose-byoi.yml up
# grab some coffee?

From DockerHub

$ git clone [email protected]:robertoriv/keystoner.git keystoner
$ cd keystoner
$ docker-compose up

Testing that it Works

$ curl -I http://<docker_vm_ip|localhost>/assets/images/logo.svg 2>/dev/null | head -n 1 | cut -d$' ' -f2
200

$ curl -I http://<docker_vm_ip|localhost>/ 2>/dev/null | head -n 1 | cut -d$' ' -f2 
200

$ open http://<docker_vm_ip|localhost>/

What's Included?

  1. nginx - Used as a front-end to the app. nginx will proxy-pass requests to the app running in a container on port 3000. In addition to proxy-passing the app request, it also hosts all the files/folders in the nginx/assets directory. Those files will be served by nginx rather than the app. The docker image for nginx consists of the offical nginx image with some added configuration. nginx is listening on port 80.

  2. MongoDB - MongoDB serves as the data store for the application. This image is an unmodified official MongoDB image. (More on that later.)

  3. Keystone Demo - A basic KeystoneJS demo app.

Issues (and Other Insteresting Findings)

MongoDB

Looking at the docs for MongoDB's official image, I noticed that it said that, when running on VirtualBox, you can't mount a local folder on the host machine.

WARNING: because MongoDB uses memory mapped files it is not possible to use it through vboxsf to your host (vbox bug). VirtualBox shared folders are not supported by MongoDB (see docs.mongodb.org and related jira.mongodb.org bug). This means that it is not possible with the default setup using Docker Toolbox to run a MongoDB container with the data directory mapped to the host.

I decided to just ship an unmodified version of the image, which means that it will start with a blank slate. Not sure how you guys handle data migrations across environments, but this could prove to be a problem.

Mounting the app as a Volume in the Container

When I mounted the app folder in the container to make it easier to see changes, it started complaining because my dev box had the dependencies installed for a different version of node. There was no image that matched my current version (installed with brew). I commented out the mount.

keystoner's People

Contributors

robertoriv avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.