mmornati / docker-ghostblog

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

FEAT: Added entry point into the Dockerfile #14

Closed mmornati closed 6 years ago

mmornati commented 6 years ago

With the new ENTRYPOINT operator into the Dockerfile we are now able to have ghost execute on the PID 1 schermata 2017-11-14 alle 21 16 42

MIGRATE PROCEDURE To slim the docker start process (and allow it to start quickly) the migrate command is now executed only on demand.

docker run -v /opt/data:/var/lib/ghost/content -v /opt/myconfiguration.json:/var/lib/ghost/config.override.json mmornati/docker-ghostblog:latest migrate

INIT PROCEDURE In the same way, during the first execution of the docker, we can initialize de database.

docker run -v /opt/data:/var/lib/ghost/content -v /opt/myconfiguration.json:/var/lib/ghost/config.override.json mmornati/docker-ghostblog:latest init
pascalandy commented 6 years ago

What is the gain of putting init and migrate externally? For me I feel it's more pain so I'm not hip-hop-hooray about this :-p

mmornati commented 6 years ago

Startup performace: the docker is starting quickly as it is not always running the migrate. The init can maybe remain as before 'cause it is checking the db size. Do you prefer anything automatic?

pascalandy commented 6 years ago

Oh yes, automatic!

pascalandy commented 6 years ago

On https://github.com/mmornati/docker-ghostblog/blob/be59071f839fd21738cb68eb53c7155cfbb5001c/Dockerfile#L4

please use node:8.9.1-alpine

I was about to do a PR but you beat me!

pascalandy commented 6 years ago

Startup performance: the docker is starting quickly as it is not always running the migrate.

I don't know how you will tackle this challenge. Can we do quick query on the DB to know which ghost version was running the last time the db was access ?

mmornati commented 6 years ago

Restored automatic DB init and migration.

pascalandy commented 6 years ago

I'll test on my side :)

mmornati commented 6 years ago

I let you to accept the pull request if all is ok on your side

pascalandy commented 6 years ago

I prefer to squash and merge. Do you?