提交 e06f69f3 编写于 作者: R rsercano

trying to use debian for openshift

上级 21de3ab4
...@@ -19,7 +19,7 @@ meteor npm install ...@@ -19,7 +19,7 @@ meteor npm install
# build the bundle # build the bundle
printf "\n[-] Building Meteor application...\n\n" printf "\n[-] Building Meteor application...\n\n"
mkdir -p $APP_BUNDLE_DIR mkdir -p $APP_BUNDLE_DIR
meteor build --directory $APP_BUNDLE_DIR > /dev/null meteor build --directory $APP_BUNDLE_DIR
# run npm install in bundle # run npm install in bundle
printf "\n[-] Running npm install in the server bundle...\n\n" printf "\n[-] Running npm install in the server bundle...\n\n"
...@@ -30,4 +30,4 @@ meteor npm install --production ...@@ -30,4 +30,4 @@ meteor npm install --production
mv $BUILD_SCRIPTS_DIR/entrypoint.sh $APP_BUNDLE_DIR/bundle/entrypoint.sh mv $BUILD_SCRIPTS_DIR/entrypoint.sh $APP_BUNDLE_DIR/bundle/entrypoint.sh
# change ownership of the app to the node user # change ownership of the app to the node user
chown -R node:node $APP_BUNDLE_DIR chown -R node:node $APP_BUNDLE_DIR
\ No newline at end of file
...@@ -5,11 +5,12 @@ set -e ...@@ -5,11 +5,12 @@ set -e
# try to start local MongoDB if no external MONGO_URL was set # try to start local MongoDB if no external MONGO_URL was set
if [[ "${MONGO_URL}" == *"127.0.0.1"* ]]; then if [[ "${MONGO_URL}" == *"127.0.0.1"* ]]; then
if hash mongod 2>/dev/null; then if hash mongod 2>/dev/null; then
mkdir -p /data/{db,configdb}
printf "\n[-] External MONGO_URL not found. Starting local MongoDB...\n\n" printf "\n[-] External MONGO_URL not found. Starting local MongoDB...\n\n"
mongod --storageEngine=wiredTiger & chown -R mongodb:mongodb /data/{db,configdb}
exec gosu mongodb mongod --storageEngine=wiredTiger > /dev/null 2>&1 &
else else
echo "ERROR: Mongo not installed inside the container, try to set MONGO_URL env variable" echo "ERROR: Mongo not installed inside the container."
echo "Please supply a MONGO_URL environment variable."
exit 1 exit 1
fi fi
fi fi
...@@ -38,4 +39,4 @@ fi ...@@ -38,4 +39,4 @@ fi
# Start app # Start app
echo "=> Starting app on port $PORT..." echo "=> Starting app on port $PORT..."
exec "$@" exec "$@"
\ No newline at end of file
...@@ -6,7 +6,7 @@ printf "\n[-] Installing base OS dependencies...\n\n" ...@@ -6,7 +6,7 @@ printf "\n[-] Installing base OS dependencies...\n\n"
apt-get update -y apt-get update -y
apt-get install -y --no-install-recommends curl ca-certificates bzip2 build-essential numactl python git wget libc6 apt-get install -y --no-install-recommends curl ca-certificates bzip2 build-essential numactl python git wget
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"
...@@ -24,4 +24,4 @@ chmod +x /usr/local/bin/gosu ...@@ -24,4 +24,4 @@ chmod +x /usr/local/bin/gosu
gosu nobody true gosu nobody true
apt-get purge -y --auto-remove wget apt-get purge -y --auto-remove wget
\ No newline at end of file
...@@ -20,4 +20,4 @@ else ...@@ -20,4 +20,4 @@ else
# install # install
printf "\n[-] Installing Meteor $METEOR_VERSION...\n\n" printf "\n[-] Installing Meteor $METEOR_VERSION...\n\n"
sh /tmp/install_meteor.sh sh /tmp/install_meteor.sh
fi fi
\ No newline at end of file
...@@ -4,9 +4,9 @@ set -e ...@@ -4,9 +4,9 @@ set -e
printf "\n[-] Installing MongoDB ${MONGO_VERSION}...\n\n" printf "\n[-] Installing MongoDB ${MONGO_VERSION}...\n\n"
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv BC711F9BA15703C6 apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/$MONGO_MAJOR multiverse" | tee /etc/apt/sources.list.d/mongodb-org.list echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/$MONGO_MAJOR main" > /etc/apt/sources.list.d/mongodb-org.list
apt-get update apt-get update
...@@ -17,6 +17,9 @@ set -e ...@@ -17,6 +17,9 @@ set -e
${MONGO_PACKAGE}-mongos=$MONGO_VERSION \ ${MONGO_PACKAGE}-mongos=$MONGO_VERSION \
${MONGO_PACKAGE}-tools=$MONGO_VERSION ${MONGO_PACKAGE}-tools=$MONGO_VERSION
mkdir -p /data/{db,configdb}
chown -R mongodb:mongodb /data/{db,configdb}
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/mongodb rm -rf /var/lib/mongodb
mv /etc/mongod.conf /etc/mongod.conf.orig mv /etc/mongod.conf /etc/mongod.conf.orig
\ No newline at end of file
...@@ -14,4 +14,4 @@ rm -rf /opt/nodejs ...@@ -14,4 +14,4 @@ rm -rf /opt/nodejs
mv ${NODE_DIST} /opt/nodejs mv ${NODE_DIST} /opt/nodejs
ln -sf /opt/nodejs/bin/node /usr/bin/node ln -sf /opt/nodejs/bin/node /usr/bin/node
ln -sf /opt/nodejs/bin/npm /usr/bin/npm ln -sf /opt/nodejs/bin/npm /usr/bin/npm
\ No newline at end of file
FROM ubuntu:16.04 FROM debian:jessie
MAINTAINER R.Sercan Özdemir <info@mongoclient.com> MAINTAINER R.Sercan Özdemir <info@mongoclient.com>
RUN groupadd -r node && useradd -m -g node node RUN groupadd -r node && useradd -m -g node node
...@@ -7,7 +7,7 @@ ENV NODE_VERSION 4.7.3 ...@@ -7,7 +7,7 @@ ENV NODE_VERSION 4.7.3
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10
# install MongoDB # install MongoDB
ENV MONGO_VERSION 3.4.0 ENV MONGO_VERSION 3.4.2
ENV MONGO_MAJOR 3.4 ENV MONGO_MAJOR 3.4
ENV MONGO_PACKAGE mongodb-org ENV MONGO_PACKAGE mongodb-org
...@@ -34,7 +34,6 @@ RUN cd $BUILD_SCRIPTS_DIR && \ ...@@ -34,7 +34,6 @@ RUN cd $BUILD_SCRIPTS_DIR && \
# copy the app to the container # copy the app to the container
COPY . $APP_SOURCE_DIR COPY . $APP_SOURCE_DIR
RUN chmod -R 770 $BUILD_SCRIPTS_DIR
# install Meteor, build app, clean up # install Meteor, build app, clean up
RUN cd $APP_SOURCE_DIR && \ RUN cd $APP_SOURCE_DIR && \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册