karideo/front/Dockerfile

39 lines
908 B
Docker
Raw Normal View History

2020-01-03 21:45:49 +01:00
# base image
FROM node:latest as build
2020-01-03 21:45:49 +01:00
ADD src /application/src
ADD e2e /application/e2e
ADD package-lock.json /application/
2020-01-03 21:45:49 +01:00
ADD package.json /application/
ADD angular.json /application/
ADD browserslist /application/
ADD karma.conf.js /application/
ADD protractor.conf.js /application/
ADD tsconfig.json /application/
ADD tslint.json /application/
2020-01-03 21:45:49 +01:00
WORKDIR /application/
# add `/application/node_modules/.bin` to $PATH
ENV PATH /application/node_modules/.bin:$PATH
2020-01-03 21:45:49 +01:00
# install and cache app dependencies
RUN npm install
# generate build
RUN ng build --output-path=dist --configuration=production --base-href=/karideo/ --deploy-url=/karideo/
2020-01-03 21:45:49 +01:00
############
### prod ###
############
# base image
FROM nginx:1.16.0-alpine
# copy artifact build from the 'build environment'
COPY --from=build /application/dist /usr/share/nginx/html
# expose port 80
EXPOSE 80
# run nginx
CMD ["nginx", "-g", "daemon off;"]