Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less time for building meteor project #97

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified HISTORY.md
100644 → 100755
Empty file.
Empty file modified LICENSE.md
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Add the following to a `Dockerfile` in the root of your app:

```Dockerfile
FROM jshimko/meteor-launchpad:latest
FROM openmove/meteor-launchpad:onbuild
```

Then you can build the image with:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM debian:jessie
MAINTAINER OpenMove team

RUN groupadd -r node && useradd -m -g node node

# Gosu
ENV GOSU_VERSION 1.10

# MongoDB
ENV MONGO_VERSION 3.4.10
ENV MONGO_MAJOR 3.4
ENV MONGO_PACKAGE mongodb-org

# PhantomJS
ENV PHANTOM_VERSION 2.1.1

# build directories
ENV APP_SOURCE_DIR /opt/meteor/src
ENV APP_BUNDLE_DIR /opt/meteor/dist
ENV BUILD_SCRIPTS_DIR /opt/build_scripts

# Add entrypoint and build scripts
COPY scripts $BUILD_SCRIPTS_DIR
RUN chmod -R 750 $BUILD_SCRIPTS_DIR

RUN $BUILD_SCRIPTS_DIR/install-deps.sh

# Default values for Meteor environment variables
ENV ROOT_URL http://localhost
ENV MONGO_URL mongodb://127.0.0.1:27017/meteor
ENV PORT 3000

# EXPOSE 80

WORKDIR $APP_BUNDLE_DIR/bundle

# start the app
ENTRYPOINT ["./entrypoint.sh"]
CMD ["node", "main.js"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions base/scripts/install-deps-opt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e

printf "\n[-] Installing OPTIONAL dependencies...\n\n"

# install optional dependencies

if [ -f $APP_SOURCE_DIR/launchpad.conf ]; then
source <(grep APT_GET_INSTALL $APP_SOURCE_DIR/launchpad.conf)

if [ "$APT_GET_INSTALL" ]; then
printf "\n[-] Installing custom apt dependencies...\n\n"
apt-get update
apt-get install -y $APT_GET_INSTALL
fi
fi
18 changes: 9 additions & 9 deletions scripts/install-deps.sh → base/scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ apt-get update
# ensure we can get an https apt source if redirected
# https://github.com/jshimko/meteor-launchpad/issues/50
apt-get install -y apt-transport-https ca-certificates

if [ -f $APP_SOURCE_DIR/launchpad.conf ]; then
source <(grep APT_GET_INSTALL $APP_SOURCE_DIR/launchpad.conf)

if [ "$APT_GET_INSTALL" ]; then
printf "\n[-] Installing custom apt dependencies...\n\n"
apt-get install -y $APT_GET_INSTALL
fi
fi
#
# if [ -f $APP_SOURCE_DIR/launchpad.conf ]; then
# source <(grep APT_GET_INSTALL $APP_SOURCE_DIR/launchpad.conf)
#
# if [ "$APT_GET_INSTALL" ]; then
# printf "\n[-] Installing custom apt dependencies...\n\n"
# apt-get install -y $APT_GET_INSTALL
# fi
# fi

apt-get install -y --no-install-recommends curl bzip2 bsdtar build-essential python git wget

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 4 additions & 39 deletions Dockerfile → onbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
FROM debian:jessie
MAINTAINER Jeremy Shimko <jeremy.shimko@gmail.com>

RUN groupadd -r node && useradd -m -g node node

# Gosu
ENV GOSU_VERSION 1.10

# MongoDB
ENV MONGO_VERSION 3.4.10
ENV MONGO_MAJOR 3.4
ENV MONGO_PACKAGE mongodb-org

# PhantomJS
ENV PHANTOM_VERSION 2.1.1

# build directories
ENV APP_SOURCE_DIR /opt/meteor/src
ENV APP_BUNDLE_DIR /opt/meteor/dist
ENV BUILD_SCRIPTS_DIR /opt/build_scripts

# Add entrypoint and build scripts
COPY scripts $BUILD_SCRIPTS_DIR
RUN chmod -R 750 $BUILD_SCRIPTS_DIR
FROM openmove/meteor-launchpad:base
MAINTAINER OpenMove team

# Define all --build-arg options
ONBUILD ARG APT_GET_INSTALL
Expand Down Expand Up @@ -53,25 +31,12 @@ ONBUILD RUN if [ "$APT_GET_INSTALL" ]; then apt-get update && apt-get install -y
ONBUILD COPY . $APP_SOURCE_DIR

# install all dependencies, build app, clean up
ONBUILD RUN cd $APP_SOURCE_DIR && \
$BUILD_SCRIPTS_DIR/install-deps.sh && \
ONBUILD RUN cd $APP_SOURCE_DIR && \
$BUILD_SCRIPTS_DIR/install-deps-opt.sh && \
$BUILD_SCRIPTS_DIR/install-node.sh && \
$BUILD_SCRIPTS_DIR/install-phantom.sh && \
$BUILD_SCRIPTS_DIR/install-graphicsmagick.sh && \
$BUILD_SCRIPTS_DIR/install-mongo.sh && \
$BUILD_SCRIPTS_DIR/install-meteor.sh && \
$BUILD_SCRIPTS_DIR/build-meteor.sh && \
$BUILD_SCRIPTS_DIR/post-build-cleanup.sh

# Default values for Meteor environment variables
ENV ROOT_URL http://localhost
ENV MONGO_URL mongodb://127.0.0.1:27017/meteor
ENV PORT 3000

EXPOSE 3000

WORKDIR $APP_BUNDLE_DIR/bundle

# start the app
ENTRYPOINT ["./entrypoint.sh"]
CMD ["node", "main.js"]