Merge pull request #3960 from jsaalfeld/update_dockerfile

updating Dockerfile for Version 3
This commit is contained in:
Finn Stutzenstein 2018-11-02 08:16:30 +01:00 committed by GitHub
commit 5b3e63ac82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 12 deletions

View File

@ -1,21 +1,23 @@
FROM python:3.7-slim FROM python:3.7-slim
RUN apt-get -y update && \ RUN apt -y update && \
apt-get -y upgrade && \ apt -y upgrade && \
apt-get install -y libpq-dev supervisor curl wget xz-utils bzip2 git gcc 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 RUN useradd -m openslides
## BUILD JS STUFF ## 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
WORKDIR /app WORKDIR /app
COPY . /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 ng config -g cli.warnings.versionMismatch false && \
RUN $HOME/.yarn/bin/yarn --non-interactive cd client && \
RUN node_modules/.bin/gulp --production npm install
RUN cd client && \
ng build --prod
# INSTALL PYTHON DEPENDENCIES # INSTALL PYTHON DEPENDENCIES
USER root USER root
@ -24,8 +26,7 @@ RUN pip install .[big_mode]
## 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/* && \
rm -fr /app/bower_components && \ rm -fr /app/client/node_modules
rm -fr /app/node_modules
RUN mkdir /data && chown openslides /data RUN mkdir /data && chown openslides /data
USER openslides USER openslides

View File

@ -1,3 +1,4 @@
export const environment = { export const environment = {
production: true production: true,
urlPrefix: '/apps'
}; };