Merge pull request #4031 from jsaalfeld/fix_docker_build

fix the docker build
This commit is contained in:
Emanuel Schütze 2018-12-03 14:14:59 +01:00 committed by GitHub
commit cde1c04e5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 25 deletions

View File

@ -1,35 +1,30 @@
FROM python:3.7-slim
RUN mkdir /app
RUN apt -y update && \
apt -y upgrade && \
apt install -y libpq-dev supervisor curl wget xz-utils bzip2 git gcc gnupg2
apt install -y libpq-dev curl wget xz-utils bzip2 git gcc gnupg2 make g++
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt -y install nodejs
RUN npm install -g @angular/cli@latest
RUN useradd -m openslides
## BUILD JS STUFF
RUN mkdir /app
RUN chown -R openslides /app
WORKDIR /app
COPY . /app
RUN rm -rf /app/.virtualenv* && \
rm -rf /app/client/node_modules
RUN chown -R openslides /app
# Installing python dependencies
RUN pip install -r requirements.txt
RUN rm -rf /var/lib/apt/lists/*
# installing client
USER openslides
RUN ng config -g cli.warnings.versionMismatch false && \
cd client && \
npm install
RUN cd client && \
ng build --prod
# INSTALL PYTHON DEPENDENCIES
USER root
RUN pip install .[big_mode]
## Clean up
RUN apt-get remove -y python3-pip wget curl
RUN rm -rf /var/lib/apt/lists/* && \
rm -fr /app/client/node_modules
RUN mkdir /data && chown openslides /data
USER openslides
EXPOSE 8000
VOLUME /supervisord.conf
VOLUME /data
ng build --prod && \
./node_modules/.bin/compodoc -t -p src/tsconfig.app.json -n 'OpenSlides Documentation' -d ../openslides/static/doc -e html

View File

@ -115,6 +115,20 @@ Download the latest portable version of OpenSlides for Windows from
install steps. Simply unzip the downloaded file and run ``openslides.exe``.
Using the Dockerfile
===============================
You can either pull the image ``openslides/openslides`` or build it yourself
(via `docker build -t openslides/openslides .`). You have all prequistes installed
it to start a quick server. To see how it should be used to setup an
production environment, see `openslides-docker
<https://github.com/OpenSlides/openslides-docker>`_.
You can start a quick-setup (not for production purposes, only local testing) with:
$ docker run -v /path/to/save/something:/app/personal_data -p 4200:4200 openslides/openslides /bin/bash -c "python manage.py createsettings && python manage.py migrate && (python manage.py runserver & (cd client && npm start))"
Development
===========
@ -123,11 +137,6 @@ If you want to contribute to OpenSlides, have a look at `OpenSlides website
`instruction to install the development version
<https://github.com/OpenSlides/OpenSlides/blob/master/DEVELOPMENT.rst>`_.
In OpenSlides repository you find a ``Dockerfile`` but this is not for
production use. See our `Multi instance backend for OpenSlides
<https://github.com/OpenSlides/openslides-multiinstance-backend>`_ for more
information.
Installation for big assemblies
===============================