mmornati / docker-ghostblog

Ghost Blog Docker Container
MIT License
10 stars 6 forks source link

Various optimisations #12

Closed pascalandy closed 6 years ago

pascalandy commented 6 years ago

content.bkp

This way we saved a layer in the final image :)

ENV

It looks like each time we are using ENV docker creates a layer. I guess it's better to optimise those.

But I could not combine those 3 together without hitting an error

ENV HOME $GHOST_INSTALL
ENV PATH="${GHOST_INSTALL}/current/node_modules/knex-migrator/bin:${PATH}"
ENV NODE_ENV production

apk update && apk upgrade

As node:6 run on alpine 3.4, I think it's safer to upgrade the image

tini

I tried to use the ENTRYPOINT with run-ghost.sh but I was getting permission issues. It would be better to run this way to we could run CMD [ "/sbin/tini", "--", "/bin/sh", "-c", "node", "current/index.js" ]. Ghost would run on PID 1. It's really about best practice.

pascalandy commented 6 years ago

On VS code, the code is clean, but looks messup on github. Looks there is some glitch with spaces/tabs.

screen shot 2017-11-13 at 1 39 50 pm
mmornati commented 6 years ago

I can't understand why you are installing those packages. You are not using them into the docker file and I don't know if they are necessary for anything in Ghost. Do you have information on that part?

mmornati commented 6 years ago

About the format it is because you are mizing tabs and spaces (you can see it in your screenshot). In each editor you can configure the "tab size", so it can be different depending on your configuration. I think the github configuration is not aligned with your editor one.