Docker, mysql and seed configuration


#1

Using ghost 2.16 and mysql 5.7 with docker. I’ve figured out how to configure my docker-compose.yml to build both services and connect ghost and mysql.

I’m very curious how ghost seeds data into the mysql db and more specifically if there is a way to configure this seed (for example to change the default user to being active on start up).

My first instinct is to get hacky and execute sql commands after the db is seeded to alter it to what I require. Unfortunately it’s been very difficult to get the automation order correct (mysql container starts up -> ghost container starts up -> ghost seeds mysql -> custom sql commands run)

Any ideas?


#2

Hi,

The way to go is to execute a script at run time (when your container start). This is not hacky.

Search for the command ENTRYPOINT in your Dockerfile.

Cheers!


closed #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.