From 4b73cfd8b7ccd524ef0cc4032ab72b53c77c0fab Mon Sep 17 00:00:00 2001 From: Jeremy Altman Date: Fri, 26 Jun 2015 07:56:30 -0400 Subject: [PATCH] Adding Dockerfiles for client/server. 540co/ads-bpa#209 --- client/Dockerfile | 35 +++++++++++++++++++++++++++++++++++ server/Dockerfile | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 client/Dockerfile create mode 100644 server/Dockerfile diff --git a/client/Dockerfile b/client/Dockerfile new file mode 100644 index 0000000..77b3c8f --- /dev/null +++ b/client/Dockerfile @@ -0,0 +1,35 @@ +FROM node:0.12.5 +MAINTAINER 540 Co LLC + +RUN mkdir -p /usr/src/dre +WORKDIR /usr/src/dre + +RUN npm install -g bower grunt-cli + +RUN groupadd -r node \ +&& useradd -r -m -g node node + +# Copy source +COPY . /usr/src/dre +RUN chown -R node:node /usr/src/dre + +USER node + +# Install dependencies +RUN npm install; bower install + +# Expose port 9000 to host +EXPOSE 9000 + +# Serve App +CMD ["grunt", "serve"] + +# How to build: +# git clone https://github.com/540co/ads-bpa.git +# cd ads-bpa/client +# docker build -t dre . + +# How to run +# docker pull mongo +# docker run -d --name db mongo +# docker run -d --name dre -p 3000:3000 --link db:db dre diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..ee1aefb --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,33 @@ +FROM node:0.12.5 +MAINTAINER 540 Co LLC + +RUN mkdir -p /usr/src/dre +WORKDIR /usr/src/dre + +RUN groupadd -r node \ +&& useradd -r -m -g node node + +# Copy source +COPY . /usr/src/dre +RUN chown -R node:node /usr/src/dre + +USER node + +# Install server dependencies +RUN npm install + +# Expose port 3000 to host +EXPOSE 3000 + +# Start server +CMD ["npm", "start"] + +# How to build: +# git clone https://github.com/540co/ads-bpa.git +# cd ads-bpa/server +# docker build -t dre-backend . + +# How to run +# docker pull mongo +# docker run -d --name db mongo +# docker run -d --name dre -p 3000:3000 --link db:db dre