forked from stephengpope/meteor-production-docker-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (35 loc) · 1.58 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM ubuntu:14.04
MAINTAINER Stephen Pope, [email protected]
RUN mkdir /home/meteorapp
WORKDIR /home/meteorapp
ADD . ./meteorapp
# Do basic updates
RUN apt-get update -q && apt-get clean
# Install Python and Basic Python Tools for binary rebuilds of NPM packages
RUN apt-get install -y python python-dev python-distribute python-pip
# Get curl in order to download curl
RUN apt-get install curl -y \
# Install Meteor
&& (curl https://install.meteor.com/ | sh) \
# Build the NPM packages needed for build
&& cd /home/meteorapp/meteorapp/app \
&& meteor npm install \
# Build the Meteor app
&& meteor build --verbose ../build --directory \
# Install the version of Node.js we need.
&& cd /home/meteorapp/meteorapp/build/bundle \
&& bash -c 'curl "https://nodejs.org/dist/$(<.node_version.txt)/node-$(<.node_version.txt)-linux-x64.tar.gz" > /home/meteorapp/meteorapp/build/required-node-linux-x64.tar.gz' \
&& cd /usr/local && tar --strip-components 1 -xzf /home/meteorapp/meteorapp/build/required-node-linux-x64.tar.gz \
&& rm /home/meteorapp/meteorapp/build/required-node-linux-x64.tar.gz \
# Build the NPM packages needed for build
&& cd /home/meteorapp/meteorapp/build/bundle/programs/server \
&& npm install \
# Get rid of Meteor. We're done with it.
&& rm /usr/local/bin/meteor \
&& rm -rf ~/.meteor \
#no longer need curl
&& apt-get --purge autoremove curl -y
RUN npm install -g forever
EXPOSE 80
ENV PORT 80
CMD ["forever", "--minUptime", "1000", "--spinSleepTime", "1000", "meteorapp/build/bundle/main.js"]