On Github peterpeerdeman / moving-to-our-own-meteor-docker-infrastructure
from
to
Virtual Machines
Containers
Think of it like creating and mounting an ISO file
FROM node:0.10.40-wheezy RUN curl https://install.meteor.com/ | sh && \ apt-get install -y imagemagick COPY . /code WORKDIR /code RUN cd app && \ meteor build --directory . && \ cd bundle/programs/server && \ npm install EXPOSE 3000 CMD ["node", "app/bundle/main.js"]
docker build . --tag=$GIT_COMMIT
docker login -e test@test.com -p password docker push lifely/partup:$GIT_COMMIT
Jenkins "Docker build step plugin"
triggers on each git commit
docker pull lifely/partup:$GIT_COMMIT
docker run lifely/partup:$GIT_COMMIT -p 3000:3000 -e MONGO_URL=mongodb://locationofyourmongo -e MAIL_URL: smtp://locationofyouremailserver
--- - name: docker | start application docker: name: app image: "lifely/partup:{{ tag }}" username: "{{ docker.registry.username }}" email: "{{ docker.registry.email }}" password: "{{ docker.registry.password }}" state: reloaded restart_policy: always pull: always ports: - "{{ansible_eth1.ipv4.address}}:3000:3000" env: "{{ app.env }}" tags: app
upstream webapp { sticky secure; server 10.131.97.50:3000; server 10.131.77.207:3000; }