2016-08-17 19:04:42 +00:00
|
|
|
# Build:
|
2016-12-02 17:35:29 +00:00
|
|
|
# docker build -t tellform -f ./Dockerfile .
|
2016-08-17 19:04:42 +00:00
|
|
|
#
|
|
|
|
# Run:
|
2016-12-02 17:35:29 +00:00
|
|
|
# docker run -it tellform
|
|
|
|
FROM phusion/baseimage:0.9.19
|
2016-08-17 19:04:42 +00:00
|
|
|
MAINTAINER David Baldwynn <team@tellform.com>
|
2015-07-09 22:15:34 +00:00
|
|
|
|
2016-12-02 17:35:29 +00:00
|
|
|
# 3000 = TellForm server, 35729 = livereload, 8080 = node-inspector
|
|
|
|
EXPOSE 3000 35729 8080
|
2015-06-29 22:51:29 +00:00
|
|
|
|
2016-12-01 00:29:44 +00:00
|
|
|
# Set development environment as default
|
|
|
|
ENV NODE_ENV development
|
2016-12-02 17:35:29 +00:00
|
|
|
ENV BASE_URL tellform.dev
|
|
|
|
ENV PORT 3000
|
2016-08-17 19:04:42 +00:00
|
|
|
|
2016-12-01 00:29:44 +00:00
|
|
|
# Install Utilities
|
2016-12-02 17:35:29 +00:00
|
|
|
RUN apt-get update -q \
|
2016-12-01 00:29:44 +00:00
|
|
|
&& apt-get install -yqq \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
gcc \
|
|
|
|
make \
|
|
|
|
build-essential \
|
|
|
|
libkrb5-dev \
|
|
|
|
python \
|
|
|
|
sudo \
|
|
|
|
apt-utils \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
|
|
|
# Install nodejs
|
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
|
|
|
|
RUN sudo apt-get install -yq nodejs \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
2016-08-17 19:04:42 +00:00
|
|
|
|
|
|
|
# Install MEAN.JS Prerequisites
|
2016-12-02 17:35:29 +00:00
|
|
|
RUN npm install --quiet -g grunt bower && npm cache clean
|
2016-08-17 19:04:42 +00:00
|
|
|
|
2016-12-01 00:29:44 +00:00
|
|
|
RUN mkdir -p /opt/tellform/public/lib
|
|
|
|
WORKDIR /opt/tellform
|
2016-08-17 19:04:42 +00:00
|
|
|
|
|
|
|
# Copies the local package.json file to the container
|
|
|
|
# and utilities docker container cache to not needing to rebuild
|
|
|
|
# and install node_modules/ everytime we build the docker, but only
|
|
|
|
# when the local package.json file changes.
|
2016-12-01 00:29:44 +00:00
|
|
|
# Add npm package.json
|
|
|
|
COPY package.json /opt/tellform/package.json
|
|
|
|
RUN npm install --production
|
|
|
|
RUN mv ./node_modules ./node_modules.tmp && mv ./node_modules.tmp ./node_modules && npm install
|
2016-08-17 19:04:42 +00:00
|
|
|
|
2016-12-01 00:29:44 +00:00
|
|
|
# Add bower.json
|
|
|
|
COPY bower.json /opt/tellform/bower.json
|
|
|
|
COPY .bowerrc /opt/tellform/.bowerrc
|
2016-08-17 19:04:42 +00:00
|
|
|
|
2016-12-01 00:29:44 +00:00
|
|
|
COPY ./app /opt/tellform/app
|
|
|
|
COPY ./public /opt/tellform/public
|
|
|
|
COPY ./config /opt/tellform/config
|
|
|
|
COPY ./gruntfile.js /opt/tellform/gruntfile.js
|
|
|
|
COPY ./server.js /opt/tellform/server.js
|
|
|
|
COPY ./.env /opt/tellform/.env
|
2017-04-03 20:28:24 +00:00
|
|
|
COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js
|
2016-08-17 19:04:42 +00:00
|
|
|
|
2016-12-01 00:29:44 +00:00
|
|
|
# Run TellForm server
|
|
|
|
CMD npm start
|