realms-wiki/docker/Dockerfile

66 lines
1.5 KiB
Docker
Raw Normal View History

2016-09-12 18:12:21 +03:00
# Based on :
# https://github.com/scragg0x/realms-wiki/blob/master/docker/Dockerfile
FROM debian:jessie
MAINTAINER Theodotos Andreou theodotos.andreou@puri.sm
2016-09-22 23:04:50 +03:00
RUN apt-get update && \
apt-get -q -y dist-upgrade && \
2016-09-22 23:15:41 +03:00
apt-get install -q -y --no-install-recommends \
2016-09-22 23:04:50 +03:00
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 && \
2016-05-20 23:40:28 +03:00
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2016-05-20 23:40:28 +03:00
RUN ln -s /usr/bin/nodejs /usr/bin/node && \
npm install -g bower clean-css
2016-09-22 23:04:50 +03:00
RUN useradd -ms /bin/bash wiki
2016-05-20 23:40:28 +03:00
USER wiki
2016-09-22 23:04:50 +03:00
RUN git clone https://github.com/scragg0x/realms-wiki /home/wiki/realms-wiki
2016-09-22 23:04:50 +03:00
WORKDIR /home/wiki/realms-wiki
2016-05-20 23:40:28 +03:00
RUN virtualenv .venv && \
. .venv/bin/activate && \
pip install -r requirements.txt
2016-05-20 23:40:28 +03:00
RUN bower install
ENV WORKERS=3
ENV GEVENT_RESOLVER=ares
ENV REALMS_ENV=docker
2016-09-22 23:04:50 +03:00
ENV REALMS_WIKI_PATH=/home/wiki/data/repo
ENV REALMS_DB_URI='sqlite:////home/wiki/data/wiki.db'
2016-05-20 23:40:28 +03:00
2016-09-22 23:04:50 +03:00
RUN mkdir /home/wiki/data && touch /home/wiki/data/.a
VOLUME /home/wiki/data
EXPOSE 5000
2016-05-20 23:40:28 +03:00
CMD . .venv/bin/activate && \
gunicorn \
--name realms-wiki \
--access-logfile - \
--error-logfile - \
--worker-class gevent \
--workers ${WORKERS} \
--bind 0.0.0.0:5000 \
2016-09-22 23:04:50 +03:00
--chdir /home/wiki/realms-wiki \
2016-05-20 23:40:28 +03:00
'realms:create_app()'