Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy Meteor and Phusion Docker to Digital Ocean with Docker?

What is a workflow for deploying to Digital Ocean with 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's 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 [email protected]
# 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 is working and then I'm not sure how to really manage update/deploy/running?

E.g, how would you also handle updating the app without rebuilding the docker image?

like image 886
Daniel Fischer Avatar asked Nov 01 '22 17:11

Daniel Fischer


1 Answers

Here is my suggested workflow:

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

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

  3. Update the image when needed and commit your changes with docker commit then push the updated image to your repository (you should properly version and tag all your images)

  4. You can start a digital ocean droplet with docker pre-installed (from applications tab) and simply pull your image and run your container. Whenever you update and push your image from your development machine, simple pull it again from the droplet.

For large and complex infrastructure, I would recommend looking into Ansible to configure your docker containers and manage digital ocean droplet as well.

Be aware that your data will be lost if you stop the container, so consider defining a volume in your container that is mapped to a shared folder on your host machine

like image 139
iTech Avatar answered Nov 09 '22 09:11

iTech