FROM debian:jessie MAINTAINER Michał "rysiek" Woźniak ENV DEBIAN_FRONTEND noninteractive # install the required packages RUN apt-get update && \ apt-get install -y --no-install-recommends \ nodejs \ ca-certificates \ npm \ curl \ --no-install-recommends && \ rm -rf /var/lib/apt/lists/* # yeah, we need that because bin/installDeps.sh looks for node # and debian has nodejs RUN ln -s /usr/bin/nodejs /usr/bin/node # get the newest nodejs version RUN npm cache clean -f && npm install -g n && n stable # make it sane, security-wise RUN mkdir -p /opt/hazel /opt/hazel/config /opt/hazel/themes/default/public /opt/hazel/uploads /opt/hazel/content /opt/hazel/data && \ groupadd -r hazel && \ useradd -d /opt/hazel -r -g `getent group hazel | cut -d: -f3` hazel # yay, clone the repo! RUN cd /opt/hazel && npm install hazel-wiki --save && cp -a /opt/hazel/node_modules/hazel-wiki/app/themes/default/ /opt/hazel/themes/ COPY ./server.js /opt/hazel/ COPY ./config.default.js /opt/hazel/config/ # install the deps # sync used due to a bug in Docker, working around "text file busy" error RUN cd /opt/hazel/ && \ chown -R hazel:hazel ./ # entrypoint script #COPY start.sh /opt/hazel/start.sh #RUN chmod ug+x /opt/hazel/start.sh # expose, volume EXPOSE 3000 VOLUME ["/opt/hazel/config/", "/opt/hazel/themes/", "/opt/hazel/uploads/", "/opt/hazel/content/", "/opt/hazel/data/", "/var/log/hazel/"] # user, workdir USER hazel WORKDIR "/opt/hazel" # command #CMD ["/opt/hazel/start.sh"] CMD ["/usr/bin/node", "server.js"]