Commit 0645c5eb authored by Dave Lane's avatar Dave Lane

working Faye server, on 14.04

parent 8b83c03a
......@@ -70,27 +70,13 @@ RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
&& apt-get update -y -qq
# Download dev dependencies
RUN apt-get install -y --no-install-recommends \
build-essential \
# erlang-dev \
# libcurl4-openssl-dev \
# libicu-dev \
# libmozjs185-dev \
build-essential \
# install nodejs stack...
&& apt-get install -y nodejs \
&& npm install -g grunt-cli
# set up pm2
RUN npm install -g pm2
# Cleanup build detritus
#RUN && apt-get purge -y \
# binutils \
# build-essential \
# cpp \
# erlang-dev \
# libicu-dev \
# make \
# perl \
RUN apt-get autoremove -y && apt-get clean
# && apt-get install -y libicu52 --no-install-recommends
# Set up the language variables
ENV LANG en_NZ.UTF-8
......@@ -110,13 +96,10 @@ COPY ./conf /root/conf/
RUN chmod u+x /root/conf/*.sh
# expose relevant ports
EXPOSE 8380
# VOLUME ["/opt/wenotes"]
EXPOSE 80
VOLUME ["/opt/wenotes/server", "/opt/wenotes/server/options.json"]
# First, say we're doing it
RUN echo "running run.sh - /root/conf/run.sh"
# Actually do it.
RUN /root/conf/run.sh
# Say we're finished
RUN echo "finished run.sh"
CMD ["/bin/bash"]
# Actually do it when we run the container.
ENTRYPOINT ["tini", "--", "/root/conf/run.sh"]
CMD ["faye"]
......@@ -31,34 +31,43 @@ if [[ -f $CONF/pre-install.sh ]] ; then
source $CONF/pre-install.sh
fi
echo "starting services"
echo "arg 1 = $1"
# next, get the Javascript code:
# get the repo
echo "moving to $WENOTES"
if [[ ! -d $WENOTES ]] ; then
echo "creating directory $WENOTES"
mkdir -p $WENOTES
fi
cd $WENOTES
echo "getting $WESERVER, putting it into server"
$GIT clone $WESERVER server
if [ "$1" = 'faye' ]; then
echo "starting services"
# next start various Javascript services
if [[ -f $CONF/faye.yml ]] ; then
echo "moving to server"
cd $WENOTES/server
echo "installing Node.JS dependencies"
$NPM install
$CP $CONF/options.json options.json
echo "starting pm2 to supervise scripts in $CONF/faye.yml"
$PM2 start --no-daemon $CONF/faye.yml
# next, get the Javascript code:
# get the repo
echo "moving to $WENOTES"
if [[ ! -d $WENOTES ]] ; then
echo "creating directory $WENOTES"
mkdir -p $WENOTES
fi
cd $WENOTES
fi
echo "getting $WESERVER, putting it into server"
$GIT clone $WESERVER server
echo "returning to original dir: $CWD"
cd $CWD
# next start various Javascript services
if [[ -f $CONF/faye.yml ]] ; then
echo "moving to server"
cd $WENOTES/server
echo "installing Node.JS dependencies"
$NPM install
# this will be provided on the local filesystem, linked via a volume...
# $CP $CONF/options.json options.json
echo "starting pm2 to supervise scripts in $CONF/faye.yml"
$PM2 start --no-daemon $CONF/faye.yml
#$PM2 start $CONF/faye.yml
cd $WENOTES
fi
echo "returning to original dir: $CWD"
cd $CWD
else
echo "no-op!"
fi
echo "finished services"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment