node.js - Using two docker files - dev and prod -


hei,

i'm using docker file create image production code, doesn't include source code:

from         node:latest  maintainer   fatima alves  copy         ./dist            /mya-app/dist/ copy         ./s3options.json  /mya-app/ copy         ./node_modules    /mya-app/node_modules workdir                        /mya-app  entrypoint   ["node", "./dist/"] 

and create image work in machine, devimage. in case, folder src must included, , entrypoint ["node", "./dist"].

is possible include in dockerfile, or need 2 files, 1 dev , other prod?

thanks in advance!

as far know need 2 dockerfiles. in environments use dockerfile , dockerfile.dev

docker build -f dockerfile.dev -t code:dev . 

or

docker built -t code:prod . 

Comments