annotate docker/Dockerfile.spa @ 596:6d7c0dbf9d21

Fix running client container with clean checkout in volume The vue CLI Service needs to be installed locally into the project in order to be able to run 'yarn serve'. Use make for dependency installation because the makefile will get updated whenever the process changes. In passing: docs and more robust sources.list adaptation
author Tom Gottfried <tom@intevation.de>
date Fri, 07 Sep 2018 14:43:15 +0200
parents 11d527b3321b
children ed2dd10a94b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
506
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
1 FROM ubuntu:bionic
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
2 LABEL authors="tom@intevation.de"
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
3
596
6d7c0dbf9d21 Fix running client container with clean checkout in volume
Tom Gottfried <tom@intevation.de>
parents: 506
diff changeset
4 RUN sed -i 's/\(deb.*\)$/\1 universe/' /etc/apt/sources.list
506
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
5
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
6 RUN apt-get update &&\
596
6d7c0dbf9d21 Fix running client container with clean checkout in volume
Tom Gottfried <tom@intevation.de>
parents: 506
diff changeset
7 apt-get -y install --no-install-recommends curl nodejs make
506
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
8
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
9 # Install yarn
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
10 RUN curl https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - &&\
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
11 echo 'deb https://dl.yarnpkg.com/debian/ stable main' >> \
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
12 /etc/apt/sources.list &&\
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
13 apt-get update &&\
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
14 apt-get -y install yarn
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
15
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
16 COPY ./client /opt/gemma_spa
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
17
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
18 WORKDIR /opt/gemma_spa
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
19
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
20 EXPOSE 8080
11d527b3321b Add Dockerfile for SPA client
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
21
596
6d7c0dbf9d21 Fix running client container with clean checkout in volume
Tom Gottfried <tom@intevation.de>
parents: 506
diff changeset
22 CMD make -f Makefile.build dependencies && yarn serve