Skip to content

Instantly share code, notes, and snippets.

@adamyeats-zz
Created October 24, 2014 15:17
Show Gist options
  • Save adamyeats-zz/4a4fb6fe4a1c106f3d21 to your computer and use it in GitHub Desktop.
Save adamyeats-zz/4a4fb6fe4a1c106f3d21 to your computer and use it in GitHub Desktop.
Docker WTF
FROM centos:centos6
MAINTAINER Adam Yeats
# Pull base image.
FROM centos:centos6
# Install Node.js
RUN yum install epel-release -y
RUN yum update -y \
&& yum install nodejs npm -y
COPY . /var/www/application
WORKDIR /var/www/application
RUN npm install
EXPOSE 3000
# Define default command.
CMD ["node", "index.js"]
---
- name: install docker
yum: name=docker-io state=latest
- name: create web user
user: name=web group=docker
- name: start docker
service: name=docker state=started
- name: install docker-py
pip: name=docker-py
- name: check or build app image
docker_image: name="ocastastudios/vm-wfs-instance" path="/vagrant" state=present
- name: run containers
docker: image="ocastastudios/vm-wfs-instance" ports=3000 count={{ nodes_needed }}
with_sequence: start=3000 count={{ nodes_needed }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment