diff --git a/Dockerfile b/Dockerfile index 4c957018..b46fb3b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,13 +11,14 @@ MAINTAINER Arielle Baldwynn RUN apk add --no-cache \ git \ && rm -rf /tmp/* - +## TODO: Crush these consecutive RUN's into a single run if possible. # Install NPM Global Libraries RUN npm install --quiet -g grunt bower pm2 && npm cache clean --force WORKDIR /opt/tellform RUN mkdir -p /opt/tellform/public/lib +## TODO: Optimize layers here as copy layers can be easily reduced if saner COPY usage is achieved. # Add bower.json COPY bower.json /opt/tellform/bower.json COPY .bowerrc /opt/tellform/.bowerrc @@ -30,6 +31,7 @@ COPY ./gruntfile.js /opt/tellform/gruntfile.js COPY ./server.js /opt/tellform/server.js COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js +## TODO: Find a method that's better than this for passing ENV's if possible. # Set default ENV ENV NODE_ENV=development ENV SECRET_KEY=ChangeMeChangeMe @@ -63,6 +65,7 @@ ENV COVERALLS_REPO_TOKEN= ENV GOOGLE_ANALYTICS_ID= ENV RAVEN_DSN= +## TODO: Determine if it's necessary to have this COPY be it's own separate operation. # Copies the local package.json file to the container # and utilities docker container cache to not needing to rebuild # and install node_modules/ everytime we build the docker, but only @@ -72,6 +75,8 @@ COPY ./package.json /opt/tellform/package.json RUN npm install --only=production --quiet RUN bower install --allow-root RUN grunt build +## TODO: Determine if it would be possible to do a multi stage container where the prebuilt app is copied with nothing else from the build step. +## TODO: Make this configure things on startup in a sane way or don't if the operator passes any configuration files perhaps via a start.sh. # Run TellForm server CMD ["node", "server.js"]