Skip to content

Instantly share code, notes, and snippets.

@jswny
Created May 25, 2016 19:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jswny/d443c9af055d53229068b81014af825f to your computer and use it in GitHub Desktop.
Save jswny/d443c9af055d53229068b81014af825f to your computer and use it in GitHub Desktop.
Shell script to automatically deploy j1.io using Docker.
# This file will automatically deploy j1.io using Docker to /var/www/j1.io
printf "Starting deployment...\n"
cd /var/www
printf "Cleaning up before starting...\n"
rm -rf j1.io
docker stop j1.io
docker rm j1.io
docker rmi jswny/j1.io
printf "Getting latest build from Git...\n"
git clone https://github.com/jswny/j1.io.git
# change this line to wherever your config directory resides
cp -R ~/config j1.io
cd ./j1.io
printf "Building new image...\n"
docker build -t jswny/j1.io .
printf "Running image...\n"
# Change this line if you want to configure a different public port for the container
docker run -p 80:3000 -d --name j1.io jswny/j1.io
printf "Container successfully deployed!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment