2018-09-01 21:03:57 +02:00
|
|
|
FROM python:3.7-slim
|
|
|
|
RUN apt-get -y update && \
|
|
|
|
apt-get -y upgrade && \
|
|
|
|
apt-get install -y libpq-dev supervisor curl wget xz-utils bzip2 git gcc
|
2016-09-22 17:53:27 +02:00
|
|
|
RUN useradd -m openslides
|
2018-06-26 10:08:40 +02:00
|
|
|
|
|
|
|
## BUILD JS STUFF
|
|
|
|
RUN wget https://nodejs.org/dist/v10.5.0/node-v10.5.0-linux-x64.tar.xz -P /tmp && \
|
|
|
|
cd /tmp && tar xfvJ node-v10.5.0-linux-x64.tar.xz && \
|
|
|
|
ln -sf /tmp/node-v10.5.0-linux-x64/bin/node /usr/bin/node
|
2017-04-27 13:51:02 +02:00
|
|
|
RUN mkdir /app
|
2016-09-22 17:53:27 +02:00
|
|
|
WORKDIR /app
|
2018-06-26 10:08:40 +02:00
|
|
|
COPY . /app
|
2017-04-27 13:51:02 +02:00
|
|
|
RUN chown -R openslides /app
|
|
|
|
USER openslides
|
|
|
|
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
|
|
|
|
RUN $HOME/.yarn/bin/yarn --non-interactive
|
2018-06-26 10:08:40 +02:00
|
|
|
RUN node_modules/.bin/gulp --production
|
2016-09-22 17:53:27 +02:00
|
|
|
|
|
|
|
# INSTALL PYTHON DEPENDENCIES
|
2017-04-27 13:51:02 +02:00
|
|
|
USER root
|
2018-08-25 13:52:43 +02:00
|
|
|
RUN pip install .[big_mode]
|
2016-09-22 17:53:27 +02:00
|
|
|
|
2016-11-07 07:27:58 +01:00
|
|
|
## Clean up
|
2017-04-27 13:51:02 +02:00
|
|
|
RUN apt-get remove -y python3-pip wget curl
|
2018-06-26 10:08:40 +02:00
|
|
|
RUN rm -rf /var/lib/apt/lists/* && \
|
2018-05-28 12:45:46 +02:00
|
|
|
rm -fr /app/bower_components && \
|
|
|
|
rm -fr /app/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
|