Sign inSign up

kapost/base

By kapost

Updated over 9 years ago

Base Ruby + Node image, from passenger-docker

Image
0

3.2K

kapost/base repository overview

docker

This repo is linked to docker hub for automated builds: https://registry.hub.docker.com/u/kapost

Prerequisites

###To setup your mac run: ./setup.sh

  • Be sure your ssh key for github is cached before running setup.sh. Run: ssh-add /path/to/mygithubkey
  • Running ./setup.sh will:
    - check for ansible, and install if not present, and run this playbook to intall docker toolbox for osx and setup the docker host vm: docker-osx-setup.yml

- Ask if you want to install docker shortcut commands in /etc/profile. These are:
dockerup - Starts up docker VM "dev" and sets up your shell for docker use
dockerdown - Shuts down docker VM
dockersh - sets up your shell for docker use (by default this is run every time you open a new terminal window)
dockerstart- alias for dockerup
dockerstop - alias for dockerdown
dockershell - alias for dockershell

- The /etc/profile shortcuts include a dockerup command that will ensure docker is always running - comment the last dockerup line in /etc/profile if you don't want this

###After setup, start the nginx docker image: Note: you may need to close and reopen your terminal windows after running setup

  1. Login to docker hub:
    - docker login
  2. Start nginx docker:
    -cd /myrepoPath/nginx-config/nginx_dev_docker/
    - docker-compose up

nginx is now running! (don't run nignx locally for development alongside this docker image, it's meant to be one or the other)

  • Note: NGINX is setup to prefer local development services (and ports) by default, on the usual ports: 3002, 3005, 3008, etc.
  • NGINX will use docker images (and listening ports) as backup if local services are not listening. This should allow you to switch between running local services for development, and the using the dockerized services without any changes to the nginx config (assuming you are using the nginx docker image).

Ports for napa / docker: primary = port 3008; backup = port 53008

Now start an app:

Note: Docker images are setup to listen on 53000 ports, like: 53008, 53002, etc.

for napa:

  1. cd /myrepoPath/napa
    docker-compose up
    this will start up a napa "stack" listening on 53008, and is reachable at https://kpst.me or https://kpst.me:3443

Updating Images:

  • update to latest code you've pulled from git: docker-compose rm -f && docker-compose up

  • update everything: Run docker pull kapost/napa then docker-compose pull && docker-compose rm -f && docker-compose build and docker-compose up

  • the first command will pull the latest external dependency services only (mongo, redis, etc.)

  • the second part updates the application dependencies, like an update to Ruby: docker pull kapost/napa <-- insert Kapost app name here

Removal:

  • Remove the docker vm with: docker-machine kill dev && docker-machine rm dev
  • Edit /etc/profile to remove docker functions

Tag summary

Content type

Image

Digest

sha256:7e8df87e3

Size

317.2 MB

Last updated

over 9 years ago

docker pull kapost/base