realms-wiki/docker/Dockerfile
2016-09-12 09:06:11 -07:00

54 lines
1.4 KiB
Docker

# 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 -y dist-upgrade
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 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN ln -s /usr/bin/nodejs /usr/bin/node && \
npm install -g bower clean-css
RUN useradd -m -d /var/lib/realms -s /bin/bash wiki
USER wiki
RUN git clone https://github.com/scragg0x/realms-wiki /var/lib/realms/realms-wiki
WORKDIR /var/lib/realms/realms-wiki
RUN virtualenv .venv && \
. .venv/bin/activate && \
pip install -r requirements.txt
RUN bower install
ENV WORKERS=3
ENV GEVENT_RESOLVER=ares
ENV REALMS_ENV=docker
ENV REALMS_WIKI_PATH=/var/lib/realms/data/repo
ENV REALMS_DB_URI='sqlite:////var/lib/realms/data/wiki.db'
RUN mkdir /var/lib/realms/data && touch /var/lib/realms/data/.a
VOLUME /var/lib/realms/data
EXPOSE 5000
CMD . .venv/bin/activate && \
gunicorn \
--name realms-wiki \
--access-logfile - \
--error-logfile - \
--worker-class gevent \
--workers ${WORKERS} \
--bind 0.0.0.0:5000 \
--chdir /var/lib/realms/realms-wiki \
'realms:create_app()'