Git Product home page Git Product logo

devenv's Introduction

devenv - Docker setup for mongo and RabbitMQ

This is a script to run our development environment for nginx, mongo etc on docker.

NEW - this version uses the docker for mac

Caveats:

  • I use Mac OS 10.11.6 - your mileage may vary.
  • Docker for Mac is currently in public beta with version 1.12.0-rc4-beta20 (build 10404) and updated almost weekly. Whatever is in this repo may become outdated soon
  • with the introduction of its new abstraction to the HyperKit VM managed by the MacOS docker command, this whole script boils down to mapping the start and stop operations to a single line each of docker-compose commands. It is absolutely questionable whether the whole thing is still needed. Previously there had to be a variety of commands to be issued and this script saved a lot of time, but not any more.

Content

This project consists of a few parts, each of them is very small

  • a file docker-compose.yml which defines the different docker containers required for our development. A typical stack for some of my projects has a MongoDB, a RabbitMQ, a node.js and a nginx container.
  • some of the containers may have files here for mounting into the container, e.g. the nginx container has a folder with configuration files and security certificates which are required inside the container
  • a folder for the node container to put your project files (optional)
  • a .gitignore file to make sure that some files are excluded from source control, e.g. we always want to avoid to have the security certificates of Nginx in our git repo, but we also want to exclude the debug log of the node container.
  • a startup script devenv.sh which helps in issuing various commands to start and stop the group of containers. With the progress of the docker engine (notable version 1.12) this is almost no longer necessary.

Install

git clone https://github.com/abarbanell/devenv.git
  • the first time you need to create SSL certificates for the nginx container.
$ cd devenv
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginx.conf/cert.key -out nginx.conf/cert.crt

Use

Since the docker command runs its own HyperKit virtual machine there is actually no VM to start or stop here, you just need to make sure that the docker engine is running on your Mac.

Then the containers listed in the file docker-compose.yml will be started and stopped with

$ ./devenv.sh start
$ ./devenv.sh stop

# alternatively you could just use instead: 
$ docker-compose up -d
$ docker-compose stop

You see, the devenv.sh script is nothing much. I will leave it hanging around for a while and see whather there is a need for this wrapper in the future for some reason.

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.