From e146bc9f715de3c122e9802b2952d0ab82af126c Mon Sep 17 00:00:00 2001 From: Jochen Saalfeld Date: Tue, 30 Oct 2018 15:59:02 +0100 Subject: [PATCH] updating Dockerfile for Version 3 --- Dockerfile | 23 +++++++++++---------- client/src/environments/environment.prod.ts | 3 ++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 74799828a..f9af06564 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,23 @@ 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 +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 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 WORKDIR /app COPY . /app RUN chown -R openslides /app USER openslides -RUN curl -o- -L https://yarnpkg.com/install.sh | bash -RUN $HOME/.yarn/bin/yarn --non-interactive -RUN node_modules/.bin/gulp --production +RUN ng config -g cli.warnings.versionMismatch false && \ + cd client && \ + npm install +RUN cd client && \ + ng build --prod # INSTALL PYTHON DEPENDENCIES USER root @@ -24,8 +26,7 @@ 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/bower_components && \ - rm -fr /app/node_modules + rm -fr /app/client/node_modules RUN mkdir /data && chown openslides /data USER openslides diff --git a/client/src/environments/environment.prod.ts b/client/src/environments/environment.prod.ts index 5d0833162..cd452f718 100644 --- a/client/src/environments/environment.prod.ts +++ b/client/src/environments/environment.prod.ts @@ -1,3 +1,4 @@ export const environment = { - production: true + production: true, + urlPrefix: '/apps' };