Skip to content

Instantly share code, notes, and snippets.

@SantoshSrinivas79
Forked from so0k/start.sh
Created May 20, 2016 03:32
Show Gist options
  • Save SantoshSrinivas79/ff3d837484bfc8ddf4139772813e4c30 to your computer and use it in GitHub Desktop.
Save SantoshSrinivas79/ff3d837484bfc8ddf4139772813e4c30 to your computer and use it in GitHub Desktop.
meteor up
#!/bin/bash
APPNAME=<%= appName %>
APP_PATH=/opt/$APPNAME
BUNDLE_PATH=$APP_PATH/current
ENV_FILE=$APP_PATH/config/env.list
PORT=<%= port %>
USE_LOCAL_MONGO=<%= useLocalMongo? "1" : "0" %>
# remove previous version of the app, if exists
docker rm -f $APPNAME
# remove frontend container if exists
docker rm -f $APPNAME-frontend
set -e
docker build -t meteorhacks/meteord:app - << EOF
FROM meteorhacks/meteord:base
RUN apt-get install graphicsmagick -y
EOF
if [ "$USE_LOCAL_MONGO" == "1" ]; then
docker run \
-d \
--restart=always \
--publish=$PORT:80 \
--volume=$BUNDLE_PATH:/bundle \
--env-file=$ENV_FILE \
--link=mongodb:mongodb \
--hostname="$HOSTNAME-$APPNAME" \
--env=MONGO_URL=mongodb://mongodb:27017/$APPNAME \
--name=$APPNAME \
meteorhacks/meteord:app
else
docker run \
-d \
--restart=always \
--publish=$PORT:80 \
--volume=$BUNDLE_PATH:/bundle \
--hostname="$HOSTNAME-$APPNAME" \
--env-file=$ENV_FILE \
--name=$APPNAME \
meteorhacks/meteord:app
fi
<% if(typeof sslConfig === "object") { %>
docker pull meteorhacks/mup-frontend-server:latest
docker run \
-d \
--restart=always \
--volume=/opt/$APPNAME/config/bundle.crt:/bundle.crt \
--volume=/opt/$APPNAME/config/private.key:/private.key \
--link=$APPNAME:backend \
--publish=<%= sslConfig.port %>:443 \
--name=$APPNAME-frontend \
meteorhacks/mup-frontend-server /start.sh
<% } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment