diff --git a/.docker/build-meteor.sh b/.docker/build-meteor.sh index c285dc1aa50d6a5ec56d5c3e905149f953d048e5..74bcc7296541a0d5632766d1edd0d55b085a8710 100644 --- a/.docker/build-meteor.sh +++ b/.docker/build-meteor.sh @@ -19,7 +19,7 @@ meteor npm install # build the bundle printf "\n[-] Building Meteor application...\n\n" mkdir -p $APP_BUNDLE_DIR -meteor build --directory $APP_BUNDLE_DIR > /dev/null +meteor build --directory $APP_BUNDLE_DIR # run npm install in bundle printf "\n[-] Running npm install in the server bundle...\n\n" @@ -30,4 +30,4 @@ meteor npm install --production mv $BUILD_SCRIPTS_DIR/entrypoint.sh $APP_BUNDLE_DIR/bundle/entrypoint.sh # 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 diff --git a/.docker/entrypoint.sh b/.docker/entrypoint.sh index 43cdcce0a9da6b5b773fc462d2be380ed5d41400..73b69986c040edf18dfbeb47e0ab382d71e71fda 100644 --- a/.docker/entrypoint.sh +++ b/.docker/entrypoint.sh @@ -5,11 +5,12 @@ set -e # try to start local MongoDB if no external MONGO_URL was set if [[ "${MONGO_URL}" == *"127.0.0.1"* ]]; 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" - mongod --storageEngine=wiredTiger & + chown -R mongodb:mongodb /data/{db,configdb} + exec gosu mongodb mongod --storageEngine=wiredTiger > /dev/null 2>&1 & 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 fi fi @@ -38,4 +39,4 @@ fi # Start app echo "=> Starting app on port $PORT..." -exec "$@" +exec "$@" \ No newline at end of file diff --git a/.docker/install-deps.sh b/.docker/install-deps.sh index c46431746644dbc0ac751ff94d68fb05fe442c69..5fc18a0e7d01b7eb2c7871c75a62e8b2a3067777 100644 --- a/.docker/install-deps.sh +++ b/.docker/install-deps.sh @@ -6,7 +6,7 @@ printf "\n[-] Installing base OS dependencies...\n\n" 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 }')" @@ -24,4 +24,4 @@ chmod +x /usr/local/bin/gosu gosu nobody true -apt-get purge -y --auto-remove wget +apt-get purge -y --auto-remove wget \ No newline at end of file diff --git a/.docker/install-meteor.sh b/.docker/install-meteor.sh index 521d98ddbe9b6e08c7de1f8844ed701cd7dbd9f7..3ed71dca34b9c6dafe7c2271d601acb333e38759 100644 --- a/.docker/install-meteor.sh +++ b/.docker/install-meteor.sh @@ -20,4 +20,4 @@ else # install printf "\n[-] Installing Meteor $METEOR_VERSION...\n\n" sh /tmp/install_meteor.sh -fi +fi \ No newline at end of file diff --git a/.docker/install-mongo.sh b/.docker/install-mongo.sh index 57c3a946bc6ad4540fd2b384250f49229c3ae189..c1025429355235613557d89a288fb24213811ea7 100644 --- a/.docker/install-mongo.sh +++ b/.docker/install-mongo.sh @@ -4,9 +4,9 @@ set -e 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 @@ -17,6 +17,9 @@ set -e ${MONGO_PACKAGE}-mongos=$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/mongodb - mv /etc/mongod.conf /etc/mongod.conf.orig + mv /etc/mongod.conf /etc/mongod.conf.orig \ No newline at end of file diff --git a/.docker/install-node.sh b/.docker/install-node.sh index 9db8d970b87201a90c7d4a1d28480d069ca70a63..85cdd8e988e736319cb4acd83f5aa206c10a3386 100644 --- a/.docker/install-node.sh +++ b/.docker/install-node.sh @@ -14,4 +14,4 @@ rm -rf /opt/nodejs mv ${NODE_DIST} /opt/nodejs 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 diff --git a/Dockerfile b/Dockerfile index 48f4c822b4e73a6ae5b104aff48a9964e330d635..a23f9e4d4418eebcafb53437415fdb17cf04c7cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM debian:jessie MAINTAINER R.Sercan Ă–zdemir RUN groupadd -r node && useradd -m -g node node @@ -7,7 +7,7 @@ ENV NODE_VERSION 4.7.3 ENV GOSU_VERSION 1.10 # install MongoDB -ENV MONGO_VERSION 3.4.0 +ENV MONGO_VERSION 3.4.2 ENV MONGO_MAJOR 3.4 ENV MONGO_PACKAGE mongodb-org @@ -34,7 +34,6 @@ RUN cd $BUILD_SCRIPTS_DIR && \ # copy the app to the container COPY . $APP_SOURCE_DIR -RUN chmod -R 770 $BUILD_SCRIPTS_DIR # install Meteor, build app, clean up RUN cd $APP_SOURCE_DIR && \