11# ###########################################################
2- # Dockerfile the demeteorizers a Meteor app, and runs
3- # as a standard node app.
2+ # Builds a Meteor 0.9.x+ application Docker image
3+ #
44# See: http://docs.docker.io/
5+ #
6+ # Important: Best to run from a clean directory that hasn't had meteor run in it.
7+ # Important: packages/<pkg>/.npm and .build* should not exist
8+ #
59# Example usage:
6- # cd appdir
7- # docker build --tag="ongoworks/reaction:0.1.0 " . #build step
8- # docker push ongoworks/reaction:0.1.0 #push to docker repo
9- # docker run -p 127.0.0.1:8080:8080 ongoworks/reaction:0.1.0 #run
10- # ###########################################################
10+ # cd appdir #in app dir
11+ # docker build --tag="<org>/<app> " . #build step
12+ # docker push <org>/<app> #push to docker repo
13+ # docker run -p 127.0.0.1:8080:8080 <org>/<app> #run
14+ # #############################################################
1115
12- FROM node
16+ FROM google/debian:wheezy
1317MAINTAINER Aaron Judd <
[email protected] >
1418
15- # Install required packages first
16- RUN apt-get update && apt-get install -qq -y curl git gcc make build-essential imagemagick
19+ # install node + (optional imagemagick for cfs:graphicsmagick)
20+ RUN apt-get update -y && apt-get install --no-install-recommends -y -q curl python gcc make build-essential git ca-certificates nano
21+ RUN mkdir /nodejs && curl http://nodejs.org/dist/v0.10.29/node-v0.10.29-linux-x64.tar.gz | tar xvzf - -C /nodejs --strip-components=1
22+ ENV PATH $PATH:/nodejs/bin
23+
24+ # install imagemagick (optional for cfs:graphicsmagick)
25+ RUN apt-get install --no-install-recommends -y -q chrpath libfreetype6 libfreetype6-dev libssl-dev libfontconfig1 imagemagick
1726
18- # Update to latest node
19- RUN npm cache clean -f && npm install -g n && n 0.10.29
27+ # install forever and phantomjs (optional for spiderable)
28+ RUN npm install --silent -g forever phantomjs
2029
2130# Install Meteor
2231RUN curl https://install.meteor.com | /bin/sh
23- RUN npm install --silent -g forever meteorite phantomjs
24-
25- # Add current dir+subs to meteorsrc
26- ADD . ./meteorsrc
27- WORKDIR /meteorsrc
32+ ADD . /meteor/src
33+ WORKDIR /meteor/src/
2834
2935# Bundle meteorsrc to /var/www/app
30- RUN mrt install && meteor bundle --directory /var/www/app
31-
32- # Set the working directory to be used for commands that are run, including the default CMD below
33- RUN cd /var/www/app/programs/server && npm install
34- WORKDIR /var/www/app
36+ RUN meteor build --directory /meteor
37+ RUN cd /meteor/bundle/programs/server/ && npm install
38+ WORKDIR /meteor/bundle
3539
3640#
37- # Default ENV settings for meteor app
38- # Required to run meteor!
41+ # Default Meteor ENV settings for meteor app
3942# either change these or pass as --env in the docker run
4043#
4144ENV PORT 8080
4245ENV ROOT_URL "http://127.0.0.1"
4346ENV MONGO_URL "mongodb://127.0.0.1:3001/meteor"
44-
47+ ENV DISABLE_WEBSOCKETS "1"
4548
4649# Expose container port 8080 to the host (outside the container)
4750EXPOSE 8080
4851
4952RUN touch .foreverignore
53+
5054# Define default command that runs the node app on container port 8080
51- CMD forever -w ./main.js
55+ CMD forever -w ./main.js
56+
57+
58+ # Clean up APT when done.
59+ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /meteor/src
0 commit comments