Merge pull request #3769 from emanuelschuetze/fix-dockerfile

Fix dockerfile to build with gulp4/node10.
This commit is contained in:
Emanuel Schütze 2018-07-02 21:32:37 +02:00 committed by GitHub
commit e9b23c89c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 15 deletions

View File

@ -8,7 +8,7 @@ python:
- "3.5" - "3.5"
- "3.6" - "3.6"
env: env:
- TRAVIS_NODE_VERSION="10.1" - TRAVIS_NODE_VERSION="10.5"
before_install: before_install:
- nvm install $TRAVIS_NODE_VERSION - nvm install $TRAVIS_NODE_VERSION
- curl -o- -L https://yarnpkg.com/install.sh | bash - curl -o- -L https://yarnpkg.com/install.sh | bash

View File

@ -1,39 +1,33 @@
FROM python:3.5 FROM python:3.5
RUN apt-get -y update && apt-get -y upgrade RUN apt-get -y update && apt-get -y upgrade
RUN apt-get install -y libpq-dev supervisor curl vim RUN apt-get install -y libpq-dev supervisor curl vim
## BUILD JS STUFF
RUN wget https://nodejs.org/dist/v10.1.0/node-v10.1.0-linux-x64.tar.xz -P /tmp && \
cd /tmp && tar xfvJ node-v10.1.0-linux-x64.tar.xz && \
ln -sf /tmp/node-v10.1.0-linux-x64/bin/node /usr/bin/node
RUN useradd -m openslides RUN useradd -m openslides
## 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
RUN mkdir /app RUN mkdir /app
COPY package.json yarn.lock bower.json gulpfile.js /app/
WORKDIR /app WORKDIR /app
COPY . /app
RUN chown -R openslides /app RUN chown -R openslides /app
USER openslides USER openslides
RUN curl -o- -L https://yarnpkg.com/install.sh | bash RUN curl -o- -L https://yarnpkg.com/install.sh | bash
RUN $HOME/.yarn/bin/yarn --non-interactive RUN $HOME/.yarn/bin/yarn --non-interactive
RUN node_modules/.bin/gulp --production
# INSTALL PYTHON DEPENDENCIES # INSTALL PYTHON DEPENDENCIES
USER root USER root
COPY requirements_*.txt /app/
RUN pip install -r /app/requirements_big_mode.txt RUN pip install -r /app/requirements_big_mode.txt
## Clean up ## Clean up
RUN apt-get remove -y python3-pip wget curl RUN apt-get remove -y python3-pip wget curl
RUN rm -rf /var/lib/apt/lists/* RUN rm -rf /var/lib/apt/lists/* && \
# BUILD APP
ADD . /app
RUN node_modules/.bin/gulp --production && \
rm -fr /app/bower_components && \ rm -fr /app/bower_components && \
rm -fr /app/node_modules rm -fr /app/node_modules
RUN mkdir /data && chown openslides /data RUN mkdir /data && chown openslides /data
USER openslides USER openslides
EXPOSE 8000 EXPOSE 8000
USER openslides
VOLUME /supervisord.conf VOLUME /supervisord.conf
VOLUME /data VOLUME /data