From b969f3f1fccaf5e4e7b849ca69c9601d52e5beec Mon Sep 17 00:00:00 2001 From: root Date: Mon, 12 Sep 2016 08:12:21 -0700 Subject: [PATCH] Debianize Docker file --- docker/Dockerfile | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index d57ac7a..3fb6b71 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,10 @@ -FROM ubuntu:trusty +# Based on : +# https://github.com/scragg0x/realms-wiki/blob/master/docker/Dockerfile + +FROM debian:jessie + +MAINTAINER Theodotos Andreou theodotos.andreou@puri.sm + RUN apt-get update RUN apt-get install -y software-properties-common python-software-properties python-pip python-dev libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libyaml-dev libssl-dev libsasl2-dev libldap2-dev npm git python-virtualenv && \ @@ -8,13 +14,13 @@ RUN apt-get install -y software-properties-common python-software-properties RUN ln -s /usr/bin/nodejs /usr/bin/node && \ npm install -g bower clean-css -RUN useradd -ms /bin/bash wiki +RUN useradd -m -d /var/lib/realms -s /bin/bash wiki USER wiki -RUN git clone https://github.com/scragg0x/realms-wiki /home/wiki/realms-wiki +RUN git clone https://github.com/scragg0x/realms-wiki /var/lib/realms/realms-wiki -WORKDIR /home/wiki/realms-wiki +WORKDIR /var/lib/realms/realms-wiki RUN virtualenv .venv && \ . .venv/bin/activate && \ @@ -26,11 +32,11 @@ ENV WORKERS=3 ENV GEVENT_RESOLVER=ares ENV REALMS_ENV=docker -ENV REALMS_WIKI_PATH=/home/wiki/data/repo -ENV REALMS_DB_URI='sqlite:////home/wiki/data/wiki.db' +ENV REALMS_WIKI_PATH=/var/lib/realms/data/repo +ENV REALMS_DB_URI='sqlite:////var/lib/realms/data/wiki.db' -RUN mkdir /home/wiki/data && touch /home/wiki/data/.a -VOLUME /home/wiki/data +RUN mkdir /var/lib/realms/data && touch /var/lib/realms/data/.a +VOLUME /var/lib/realms/data EXPOSE 5000 @@ -42,5 +48,5 @@ CMD . .venv/bin/activate && \ --worker-class gevent \ --workers ${WORKERS} \ --bind 0.0.0.0:5000 \ - --chdir /home/wiki/realms-wiki \ + --chdir /var/lib/realms/realms-wiki \ 'realms:create_app()'