OpenSlides/Dockerfile

36 lines
830 B
Docker
Raw Normal View History

2018-09-01 21:03:57 +02:00
FROM python:3.7-slim
2018-10-30 15:59:02 +01:00
RUN apt -y update && \
apt -y upgrade && \
apt install -y libpq-dev supervisor curl wget xz-utils bzip2 git gcc gnupg2
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt -y install nodejs
RUN npm install -g @angular/cli@latest
2016-09-22 17:53:27 +02:00
RUN useradd -m openslides
## BUILD JS STUFF
2017-04-27 13:51:02 +02:00
RUN mkdir /app
2016-09-22 17:53:27 +02:00
WORKDIR /app
COPY . /app
2017-04-27 13:51:02 +02:00
RUN chown -R openslides /app
USER openslides
2018-10-30 15:59:02 +01:00
RUN ng config -g cli.warnings.versionMismatch false && \
cd client && \
npm install
RUN cd client && \
ng build --prod
2016-09-22 17:53:27 +02:00
# INSTALL PYTHON DEPENDENCIES
2017-04-27 13:51:02 +02:00
USER root
RUN pip install .[big_mode]
2016-09-22 17:53:27 +02:00
## Clean up
2017-04-27 13:51:02 +02:00
RUN apt-get remove -y python3-pip wget curl
RUN rm -rf /var/lib/apt/lists/* && \
2018-10-30 15:59:02 +01:00
rm -fr /app/client/node_modules
2016-09-22 17:53:27 +02:00
RUN mkdir /data && chown openslides /data
USER openslides
EXPOSE 8000
VOLUME /supervisord.conf
VOLUME /data