Created
October 24, 2014 15:17
-
-
Save adamyeats-zz/4a4fb6fe4a1c106f3d21 to your computer and use it in GitHub Desktop.
Docker WTF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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