Debianize Docker file

This commit is contained in:
root 2016-09-12 08:12:21 -07:00
parent d4edaf4d6d
commit b969f3f1fc

View file

@ -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 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 && \ 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 && \ RUN ln -s /usr/bin/nodejs /usr/bin/node && \
npm install -g bower clean-css 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 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 && \ RUN virtualenv .venv && \
. .venv/bin/activate && \ . .venv/bin/activate && \
@ -26,11 +32,11 @@ ENV WORKERS=3
ENV GEVENT_RESOLVER=ares ENV GEVENT_RESOLVER=ares
ENV REALMS_ENV=docker ENV REALMS_ENV=docker
ENV REALMS_WIKI_PATH=/home/wiki/data/repo ENV REALMS_WIKI_PATH=/var/lib/realms/data/repo
ENV REALMS_DB_URI='sqlite:////home/wiki/data/wiki.db' ENV REALMS_DB_URI='sqlite:////var/lib/realms/data/wiki.db'
RUN mkdir /home/wiki/data && touch /home/wiki/data/.a RUN mkdir /var/lib/realms/data && touch /var/lib/realms/data/.a
VOLUME /home/wiki/data VOLUME /var/lib/realms/data
EXPOSE 5000 EXPOSE 5000
@ -42,5 +48,5 @@ CMD . .venv/bin/activate && \
--worker-class gevent \ --worker-class gevent \
--workers ${WORKERS} \ --workers ${WORKERS} \
--bind 0.0.0.0:5000 \ --bind 0.0.0.0:5000 \
--chdir /home/wiki/realms-wiki \ --chdir /var/lib/realms/realms-wiki \
'realms:create_app()' 'realms:create_app()'