Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed dockerfile so it builds and runs the default configuration (#998)
* Fixed dockerfile so it builds and runs the default configuration * Fixed review comments and added usage description. * Make sure to install git as dependency. In package.json 'bower install' can be safely used -> will log output. * Allow bower to be run under root user.
- Loading branch information
Showing
3 changed files
with
45 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"directory": "src/client/bower_components" | ||
"directory": "src/client/bower_components", | ||
"allow_root": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,66 @@ | ||
FROM ubuntu:14.04 | ||
MAINTAINER Zsolt Lattmann <zsolt.lattmann@gmail.com> | ||
|
||
# This dockerfile is intended to build a docker image on a clean copy of the webgme repository. | ||
# | ||
# Use the following steps to build and start-up your dockerized webgme: | ||
# (assuming that you have docker properly installed on your machine) | ||
# 1. go to the directory where this file exists | ||
# 2. docker build -t webgme . | ||
# 3. docker run -d -p 8888:8888 --name=webgme webgme | ||
# | ||
# The result of your last command will be the hash id of your container. After successful startup, | ||
# you should be able to connect to your dockerized webgme on the 8888 port of your docker daemon machine | ||
# (the default ip address of the daemon is 192.168.99.100). | ||
# | ||
# Useful commands | ||
# checking the status of your docker containers: docker ps -a | ||
# restart your docker container: docker restart webgme | ||
# stop your container: docker stop webgme | ||
# removing your container: docker rm webgme | ||
# removing your image: docker rmi webgme | ||
|
||
|
||
|
||
FROM ubuntu:14.04.3 | ||
MAINTAINER Tamas Kecskes <tamas.kecskes@vanderbilt.edu> | ||
|
||
# Replace shell with bash so we can source files | ||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
# Set debconf to run non-interactively | ||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | ||
|
||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B9316A7BC7917B12 #44A334DA # 87374F5D | ||
# Install base dependencies | ||
RUN apt-get -qq update && apt-get install -y -q --no-install-recommends \ | ||
apt-transport-https \ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
git \ | ||
libssl-dev \ | ||
python \ | ||
rsync \ | ||
software-properties-common \ | ||
wget \ | ||
mongodb-server \ | ||
moreutils \ | ||
unzip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# install necessary packages | ||
RUN apt-get -qq update --fix-missing | ||
RUN apt-get install -y -q curl | ||
RUN sudo apt-get install -y -q build-essential libssl-dev mongodb-server git | ||
|
||
ENV NVM_DIR /usr/local/nvm | ||
ENV NODE_VERSION 0.10.38 | ||
ENV NODE_VERSION 4.4.4 | ||
|
||
# Install nvm with node and npm | ||
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash \ | ||
# NVM | ||
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash \ | ||
&& source $NVM_DIR/nvm.sh \ | ||
&& nvm install $NODE_VERSION \ | ||
&& nvm alias default $NODE_VERSION \ | ||
&& nvm use default | ||
|
||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules | ||
ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH | ||
|
||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH | ||
|
||
RUN mkdir /usr/app | ||
|
||
RUN echo smallfiles = true >> /etc/mongodb.conf | ||
|
||
RUN mkdir -p /project | ||
ADD package.json /project/package.json | ||
WORKDIR /usr/app | ||
|
||
# mount the current project workspace under /project inside the container | ||
ADD . /project | ||
# copy app source | ||
ADD . /usr/app/ | ||
|
||
VOLUME ["/project"] | ||
WORKDIR /project | ||
# Install app dependencies | ||
RUN npm install --unsafe-perm | ||
|
||
RUN npm install | ||
# create startup script | ||
# TODO find a way to execute with different configuraitons | ||
RUN echo '/etc/init.d/mongodb start' >> /root/run.sh &&\ | ||
echo 'npm start' >> /root/run.sh | ||
|
||
RUN echo '#!/bin/bash -ex' >> /root/run.sh &&\ | ||
echo '/etc/init.d/mongodb start' >> /root/run.sh &&\ | ||
echo 'npm install' >> /root/run.sh &&\ | ||
echo 'npm start' >> /root/run.sh | ||
|
||
EXPOSE 8888 | ||
|
||
CMD ["bash", "-xe", "/root/run.sh"] | ||
|
||
# docker build -t webgme . | ||
# docker kill webgme; docker rm webgme | ||
# docker run --rm --name webgme -e 'NODE_VERSION=0.10' -t webgme | ||
# docker run -d -p 0.0.0.0:8888:8888 --name webgme -t webgme | ||
# docker logs -f webgme | ||
# docker ps | ||
# docker exec webgme mongorestore | ||
|
||
CMD ["bash", "-xe", "/root/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters