SEL-Columbia / dokomoforms

Dokomo どこも Forms is a mobile data collection technology that doesn't suck.
http://dokomoforms.org
GNU General Public License v3.0
22 stars 23 forks source link

Dockerfile is bad #251

Open myf opened 6 years ago

myf commented 6 years ago

.. at least it's confusing, here's its full glory

ADD package.json /tmp/package.json
RUN cd /tmp && npm install && npm install lodash --save-dev
RUN cp -a /tmp/node_modules /dokomo/

why are you building node_modules in /tmp and then copy it back instead of just doing it in its folder

RUN cp -r /dokomo/dokomoforms/static/dist /var/www/static
RUN cp /dokomo/dokomoforms/static/robots.txt /var/www/static/robots.txt
RUN cp /dokomo/dokomoforms/static/manifest.json /var/www/static/manifest.json
RUN cp /dokomo/dokomoforms/static/src/common/img/favicon.png /var/www/static/favicon.png

have you heard of the COPY command? use that will cache better via docker https://docs.docker.com/engine/reference/builder/#copy