add dockerfile
move cli functions in module add configure command
This commit is contained in:
parent
d94855e3c5
commit
58f9109bd2
6 changed files with 192 additions and 131 deletions
37
docker/Dockerfile
Normal file
37
docker/Dockerfile
Normal file
|
@ -0,0 +1,37 @@
|
|||
FROM realms/base
|
||||
|
||||
# Packages
|
||||
RUN add-apt-repository -y ppa:chris-lea/node.js && apt-get update
|
||||
RUN apt-get install -y python build-essential git libpcre3-dev python-software-properties \
|
||||
python-pip python-virtualenv python-dev pkg-config curl libxml2-dev libxslt1-dev zlib1g-dev \
|
||||
libffi-dev nodejs libyaml-dev
|
||||
|
||||
# Realms Code
|
||||
RUN cd /home/deploy && git clone https://github.com/scragg0x/realms-wiki
|
||||
|
||||
# Bower stuff for frontend assets
|
||||
RUN npm install -g bower
|
||||
RUN bower --allow-root --config.cwd=/home/deploy/realms-wiki --config.directory=realms/static/vendor --config.interactive=false install
|
||||
|
||||
# Virtualenv building
|
||||
RUN virtualenv /home/deploy/realms-wiki/.venv
|
||||
RUN /home/deploy/realms-wiki/.venv/bin/pip install /home/deploy/realms-wiki
|
||||
|
||||
# Link to cli entry point
|
||||
RUN ln -s /home/deploy/realms-wiki/.venv/bin/realms-wiki /usr/local/bin/realms-wiki && chmod +x /usr/local/bin/realms-wiki
|
||||
|
||||
# Logging
|
||||
RUN mkdir /var/log/realms-wiki && chown deploy.deploy /var/log/realms-wiki
|
||||
|
||||
# Hand over to deploy user
|
||||
RUN chown -R deploy.deploy /home/deploy
|
||||
|
||||
# Upstart
|
||||
RUN mkdir /etc/service/realms-wiki
|
||||
ADD realms-wiki.sh /etc/service/realms-wiki/run
|
||||
RUN chmod +x /etc/service/realms-wiki/run
|
||||
|
||||
# Clear some fat
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
EXPOSE 5000
|
7
docker/realms-wiki.sh
Normal file
7
docker/realms-wiki.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "${REALMS_WIKI_CONFIG}" != "" ]; then
|
||||
realms-wiki configure ${REALMS_WIKI_CONFIG}
|
||||
fi
|
||||
|
||||
exec /sbin/setuser deploy realms-wiki run >>/var/log/realms-wiki/realms-wiki.log 2>&1
|
Loading…
Add table
Add a link
Reference in a new issue