forked from meteorhacks/meteord
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
244 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM debian:wheezy | ||
MAINTAINER MeteorHacks Pvt Ltd. | ||
|
||
ENV METEORD_DIR /opt/meteord | ||
COPY scripts $METEORD_DIR | ||
|
||
RUN bash $METEORD_DIR/init.sh | ||
|
||
EXPOSE 80 | ||
ENTRYPOINT bash $METEORD_DIR/run_app.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
set -e | ||
|
||
bash $METEORD_DIR/lib/install_base.sh | ||
bash $METEORD_DIR/lib/install_node.sh | ||
bash $METEORD_DIR/lib/install_phantomjs.sh | ||
bash $METEORD_DIR/lib/cleanup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
set -e | ||
|
||
COPIED_APP_PATH=/copied-app | ||
BUNDLE_DIR=/tmp/bundle-dir | ||
|
||
# sometimes, directly copied folder cause some wierd issues | ||
# this fixes that | ||
cp -R /app $COPIED_APP_PATH | ||
cd $COPIED_APP_PATH | ||
|
||
meteor build --directory $BUNDLE_DIR --server=http://localhost:3000 | ||
|
||
cd $BUNDLE_DIR/bundle/programs/server/ | ||
npm i | ||
|
||
mv $BUNDLE_DIR/bundle /built_app | ||
|
||
# cleanup | ||
rm -rf $COPIED_APP_PATH | ||
rm -rf $BUNDLE_DIR | ||
rm -rf ~/.meteor | ||
rm /usr/local/bin/meteor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Borrowed from: https://github.com/chriswessels/meteor-tupperware | ||
|
||
set -e | ||
# Autoremove any junk | ||
apt-get autoremove -y | ||
|
||
# Clean out docs | ||
rm -rf /usr/share/doc /usr/share/doc-base /usr/share/man /usr/share/locale /usr/share/zoneinfo | ||
|
||
# Clean out package management dirs | ||
rm -rf /var/lib/cache /var/lib/log | ||
|
||
# Clean out /tmp | ||
rm -rf /tmp/* | ||
|
||
# Clear npm cache | ||
npm cache clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
set -e | ||
apt-get update -y | ||
apt-get install -y curl bzip2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set -e | ||
|
||
curl https://install.meteor.com | /bin/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
scripts/install_phantomjs.sh → base/scripts/lib/install_phantomjs.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# Install PhantomJS | ||
set -e | ||
apt-get -y install libfreetype6 libfreetype6-dev fontconfig | ||
ARCH=`uname -m` | ||
PHANTOMJS_VERSION=1.9.8 | ||
PHANTOMJS_TAR_FILE=phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}.tar.bz2 | ||
|
||
cd /usr/local/share/ | ||
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}.tar.bz2 | ||
tar xjf phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}.tar.bz2 | ||
curl -L -O https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}.tar.bz2 | ||
tar xjf $PHANTOMJS_TAR_FILE | ||
ln -s -f /usr/local/share/phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}/bin/phantomjs /usr/local/share/phantomjs | ||
ln -s -f /usr/local/share/phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}/bin/phantomjs /usr/local/bin/phantomjs | ||
ln -s -f /usr/local/share/phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}/bin/phantomjs /usr/bin/phantomjs | ||
|
||
rm $PHANTOMJS_TAR_FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
bash $METEORD_DIR/lib/install_meteor.sh | ||
bash $METEORD_DIR/lib/build_app.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
set -e | ||
|
||
if [ -d /bundle ]; then | ||
cd /bundle | ||
tar xzf *.tar.gz | ||
cd /bundle/bundle/programs/server/ | ||
npm i | ||
cd /bundle/bundle/ | ||
elif [[ $BUNDLE_URL ]]; then | ||
cd /tmp | ||
curl -L -o bundle.tar.gz $BUNDLE_URL | ||
tar xzf bundle.tar.gz | ||
cd /tmp/bundle/programs/server/ | ||
npm i | ||
cd /tmp/bundle/ | ||
elif [ -d /built_app ]; then | ||
cd /built_app | ||
else | ||
echo "=> You don't have an meteor app to run in this image." | ||
exit 1 | ||
fi | ||
|
||
if [[ $REBULD_NPM_MODULES ]]; then | ||
if [ -f /opt/meteord/rebuild_npm_modules.sh ]; then | ||
cd programs/server | ||
bash /opt/meteord/rebuild_npm_modules.sh | ||
cd ../../ | ||
else | ||
echo "=> Use meteorhacks/meteord:bin-build for binary bulding." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
export PORT=80 | ||
echo "=> Starting meteor app on port:$PORT" | ||
node main.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM meteorhacks/meteord:base | ||
MAINTAINER MeteorHacks Pvt Ltd. | ||
|
||
COPY scripts/install_binbuild_tools.sh $METEORD_DIR/install_binbuild_tools.sh | ||
COPY scripts/rebuild_npm_modules.sh $METEORD_DIR/rebuild_npm_modules.sh | ||
|
||
RUN bash $METEORD_DIR/install_binbuild_tools.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set -e | ||
# for npm module re-building | ||
apt-get -y install build-essential libssl-dev git python | ||
npm install -g node-gyp | ||
# pre-install node source code for faster building | ||
node-gyp install ${NODE_VERSION} | ||
|
||
bash $METEORD_DIR/lib/cleanup.sh |
1 change: 1 addition & 0 deletions
1
scripts/rebuild_npm_modules.sh → binbuild/scripts/rebuild_npm_modules.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
set -e | ||
gyp_rebuild_inside_node_modules () { | ||
for npmModule in ./*; do | ||
cd $npmModule | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM meteorhacks/meteord:base | ||
MAINTAINER MeteorHacks Pvt Ltd. | ||
|
||
ONBUILD RUN bash $METEORD_DIR/lib/install_meteor.sh | ||
ONBUILD COPY ./ /app | ||
ONBUILD RUN bash $METEORD_DIR/lib/build_app.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM meteorhacks/meteord:base | ||
MAINTAINER MeteorHacks Pvt Ltd. | ||
|
||
ONBUILD COPY ./ /app | ||
ONBUILD RUN bash $METEORD_DIR/on_build.sh |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
#!/bin/bash | ||
docker build -t meteord ../ | ||
docker build -t meteorhacks/meteord:base ../base | ||
docker build -t meteorhacks/meteord:onbuild ../onbuild | ||
docker build -t meteorhacks/meteord:devbuild ../devbuild | ||
docker build -t meteorhacks/meteord:binbuild ../binbuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
function clean() { | ||
docker rm -f binary_build | ||
} | ||
|
||
cd /tmp | ||
clean | ||
|
||
docker run -d \ | ||
--name binary_build \ | ||
-e ROOT_URL=http://binary_build_app \ | ||
-e BUNDLE_URL=https://s3.amazonaws.com/zeema-data/aa.tar.gz \ | ||
-e REBULD_NPM_MODULES=1 \ | ||
-p 9090:80 \ | ||
meteorhacks/meteord:base | ||
|
||
echo "Waiting for binary building is happening" | ||
sleep 10 | ||
|
||
appContent=`docker logs binary_build` | ||
clean | ||
|
||
if [[ $appContent != *"meteorhacks/meteord:bin-build"* ]]; then | ||
echo "Failed: Trying to binary building on the base image" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.