[DEV] basic version of the docker file for web application
This commit is contained in:
parent
4d63bbf37a
commit
4abd312761
@ -1,16 +1,39 @@
|
|||||||
# base image
|
# base image
|
||||||
FROM node:latest
|
FROM node:latest as build
|
||||||
|
|
||||||
ADD src /application/src
|
ADD src /application/src
|
||||||
|
ADD e2e /application/e2e
|
||||||
|
ADD package-lock.json /application/
|
||||||
ADD package.json /application/
|
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/
|
||||||
WORKDIR /application/
|
WORKDIR /application/
|
||||||
|
|
||||||
# add `/app/node_modules/.bin` to $PATH
|
# add `/application/node_modules/.bin` to $PATH
|
||||||
ENV PATH /app/node_modules/.bin:$PATH
|
ENV PATH /application/node_modules/.bin:$PATH
|
||||||
|
|
||||||
# install and cache app dependencies
|
# install and cache app dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# start app
|
# generate build
|
||||||
CMD ["ng", "serve", "--host", "0.0.0.0"]
|
RUN ng build --output-path=dist
|
||||||
|
|
||||||
|
############
|
||||||
|
### 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;"]
|
24
front/Dockerfile.dev
Normal file
24
front/Dockerfile.dev
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# base image
|
||||||
|
FROM node:latest
|
||||||
|
|
||||||
|
ADD src /application/src
|
||||||
|
ADD e2e /application/e2e
|
||||||
|
ADD package-lock.json /application/
|
||||||
|
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/
|
||||||
|
WORKDIR /application/
|
||||||
|
|
||||||
|
# add `/app/node_modules/.bin` to $PATH
|
||||||
|
ENV PATH /app/node_modules/.bin:$PATH
|
||||||
|
|
||||||
|
# install and cache app dependencies
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# start app
|
||||||
|
CMD ["npx", "ng", "serve", "--host", "0.0.0.0"]
|
||||||
|
|
@ -6,5 +6,6 @@ services:
|
|||||||
image: yui.heero/karideo
|
image: yui.heero/karideo
|
||||||
container_name: karideo
|
container_name: karideo
|
||||||
ports:
|
ports:
|
||||||
- 15081:4200
|
#- 15081:4200
|
||||||
|
- 15081:80
|
||||||
|
|
||||||
|
6
front/package-lock.json
generated
6
front/package-lock.json
generated
@ -10521,9 +10521,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "3.7.4",
|
"version": "3.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||||
"integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==",
|
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"uglify-js": {
|
"uglify-js": {
|
||||||
|
@ -31,19 +31,19 @@
|
|||||||
"@angular/compiler-cli": "^8.2.14",
|
"@angular/compiler-cli": "^8.2.14",
|
||||||
"@angular/language-service": "^8.2.14",
|
"@angular/language-service": "^8.2.14",
|
||||||
"@types/jasmine": "^3.5.0",
|
"@types/jasmine": "^3.5.0",
|
||||||
"@types/jasminewd2": "x",
|
"@types/jasminewd2": "^2.0.8",
|
||||||
"@types/node": "^13.1.2",
|
"@types/node": "^13.1.2",
|
||||||
"codelyzer": "^5.0.1",
|
"codelyzer": "^5.0.1",
|
||||||
"jasmine-core": "^3.5.0",
|
"jasmine-core": "^3.5.0",
|
||||||
"jasmine-spec-reporter": "x",
|
"jasmine-spec-reporter": "^4.2.1",
|
||||||
"karma": "^4.4.1",
|
"karma": "^4.4.1",
|
||||||
"karma-chrome-launcher": "^3.1.0",
|
"karma-chrome-launcher": "^3.1.0",
|
||||||
"karma-coverage-istanbul-reporter": "^2.1.1",
|
"karma-coverage-istanbul-reporter": "^2.1.1",
|
||||||
"karma-jasmine": "^2.0.1",
|
"karma-jasmine": "^2.0.1",
|
||||||
"karma-jasmine-html-reporter": "^1.5.1",
|
"karma-jasmine-html-reporter": "^1.5.1",
|
||||||
"protractor": "x",
|
"protractor": "^5.4.2",
|
||||||
"ts-node": "^8.5.4",
|
"ts-node": "^8.5.4",
|
||||||
"tslint": "x",
|
"tslint": "^5.20.1",
|
||||||
"typescript": "^3.6.0"
|
"typescript": "~3.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user