chore: provide basic docker image #177

This commit is contained in:
Johannes Millan 2019-06-08 23:19:46 +02:00
parent 1cd28dbdfc
commit 3380b815ad
2 changed files with 51 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
node_modules
.git
.gitignore

48
Dockerfile Normal file
View File

@ -0,0 +1,48 @@
# builds the app and runs the webversion inside a docker container
### build ###
# base image
FROM node:12.2.0 as build
# install chrome for protractor tests
#RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
#RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
#RUN apt-get update && apt-get install -yq google-chrome-stable
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# install and cache app dependencies
COPY package.json /app/package.json
COPY ./tools /app/tools
RUN yarn
RUN yarn global add @angular/cli@8.0.2
# add app
COPY . /app
# run tests
#RUN ng test --watch=false
#RUN ng e2e --port 4202
# generate build
RUN ng build --output-path=dist
### serve ###
# base image
FROM nginx:1.16.0-alpine
# copy artifact build from the 'build environment'
COPY --from=build /app/dist /usr/share/nginx/html
# expose port 80
EXPOSE 80
# run nginx
CMD ["nginx", "-g", "daemon off;"]