OpenSlides/Dockerfile

44 lines
1.1 KiB
Docker
Raw Normal View History

2016-09-22 17:53:27 +02:00
FROM python:3.5
RUN apt-get -y update && apt-get -y upgrade
2017-04-27 13:51:02 +02:00
RUN apt-get install -y libpq-dev supervisor curl
2016-09-22 17:53:27 +02:00
## BUILD JS STUFF
2017-09-15 13:35:03 +02:00
RUN wget https://nodejs.org/dist/v6.11.3/node-v6.11.3-linux-x64.tar.xz -P /tmp
RUN cd /tmp && tar xfvJ node-v6.11.3-linux-x64.tar.xz
RUN ln -sf /tmp/node-v6.11.3-linux-x64/bin/node /usr/bin/node
2016-09-22 17:53:27 +02:00
RUN useradd -m openslides
2017-04-27 13:51:02 +02:00
RUN mkdir /app
2016-09-22 17:53:27 +02:00
ADD package.json /app
2017-04-27 13:51:02 +02:00
ADD yarn.lock /app
2016-09-22 17:53:27 +02:00
ADD bower.json /app
2017-04-27 13:51:02 +02:00
ADD gulpfile.js /app
2016-09-22 17:53:27 +02:00
WORKDIR /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
2016-09-22 17:53:27 +02:00
# INSTALL PYTHON DEPENDENCIES
2017-04-27 13:51:02 +02:00
USER root
2016-09-22 17:53:27 +02:00
ADD requirements_production.txt /app/requirements_production.txt
RUN pip install -r /app/requirements_production.txt
RUN pip install django-redis asgi-redis django-redis-sessions psycopg2
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/*
2016-09-22 17:53:27 +02:00
# BUILD APP
ADD . /app
RUN node_modules/.bin/gulp --production
2016-09-22 17:53:27 +02:00
RUN rm -fr /app/bower_components
RUN rm -fr /app/node_modules
RUN mkdir /data && chown openslides /data
USER openslides
EXPOSE 8000
USER openslides
VOLUME /supervisord.conf
VOLUME /data