【问题标题】:How can i add a command to the meteor mupx start script?如何向流星 mupx 启动脚本添加命令?
【发布时间】:2015-09-12 22:59:15
【问题描述】:

我要补充:

运行 apt-get install graphicsmagick -y

到我的流星 mupx 应用程序启动脚本。当我将它添加到 /opt/myapp/config/start.sh 时,它显然被我的下一次部署覆盖了。构建“/opt/myapp/config/start.sh”脚本的“模板”文件在哪里?

【问题讨论】:

    标签: javascript meteor deployment docker graphicsmagick


    【解决方案1】:

    知道了!

    它位于:/usr/local/lib/node_modules/mupx/templates/linux

    【讨论】:

    • 你能分享你的启动脚本吗?我也有同样的问题。
    • @Nate Berbettini,抱歉之前没看过,我把它作为第二个答案发布了:)
    【解决方案2】:

    @Jason Cochran,是的,4 确定

       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
       # Thats the importent part for graphicsmagick
       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
    <% } %>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-03-11
      • 2012-11-27
      • 2022-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-31
      相关资源
      最近更新 更多