FROM ubuntu:17.04
#FROM node:8

RUN apt-get update
RUN apt-get install -y git curl
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
#RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
RUN apt install -y nodejs

RUN adduser acn

USER acn

RUN npm config set prefix /home/acn/npm
RUN npm i -g npm
ENV PATH $PATH:/home/acn/npm/bin
ENV PATH $PATH:/home/acn/web/node_modules/.bin
WORKDIR /home/acn/web

USER root
EXPOSE 8080

COPY ./start-web.sh /usr/bin

CMD ["/bin/bash", "start-web.sh", "start"]
