How to deploy Meteor and Phusion Docker in Digital Ocean using Docker?

What is the workflow for deploying to Digital Ocean using Phusion Docker and Node / Meteor support?

I tried:

FROM phusion/passenger-nodejs:0.9.10 # Set correct environment variables. ENV HOME /root # Use baseimage-docker init process. CMD ["/sbin/my_init"] # ssh ADD private/keys/akey.pub /tmp/your_key RUN cat /tmp/your_key >> /root/.ssh/authorized_keys && rm -f /tmp/your_key ## Download shit RUN apt-get update RUN apt-get install -qq -y python-software-properties software-properties-common curl git build-essential RUN npm install fibers@1.0.1 # install meteor RUN curl https://install.meteor.com | /bin/sh # Clean up APT when done. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Enable nginx # RUN rm -f /etc/service/nginx/down #setup app RUN mkdir /home/app/someapp ADD . /home/app/someapp WORKDIR /home/app/someapp EXPOSE 4000 CMD passenger start -p 4000 

But nothing works, and then I'm not sure how to really manage the update / deployment / launch?

For example, how would you also handle updating an application without restoring a docker image?

+5
source share
2 answers

Here is my recommended workflow:

  • Create an account on the Docker Hub , you can get 1 private repository for free. If you want to get the full private repository hosted on your own server, you can run the full docker registry and use it to host your images.

  • Create your image on your development machine (locally or on the server), then push the image to the repository using docker push

  • Update the image if necessary and copy your changes using docker commit , then push the updated image to your repository (you should view and mark all your images correctly)

  • You can launch a digital ocean droplet with a pre-installed docker (from the application tab) and just pull the image and launch your container. Whenever you update and push an image from your development machine, just pull it out of the drop.

For a large and complex infrastructure, I would recommend looking into Ansible to set up docker containers and manage a digital ocean droplet .

Keep in mind that your data will be lost if you stop the container, so consider the definition of volume in your container, which maps to the shared folder on the main machine

+2
source

I suggest you test your Docker file in a local virtual virtual machine. I wrote a tutorial on deploying a node.js application with Docker. I create several images (layers) instead of 1. When you update your application, you just need to rebuild the top layer. Hope it helps. http://vinceyuan.blogspot.com/2015/05/deploying-web-app-redis-postgres-and.html

0
source

Source: https://habr.com/ru/post/1202309/


All Articles