Flask on AWS Serverless: A learning journey - Part 2
About 3 years ago I learnt some basic Python, which I've used almost exclusively to
A few months, I mentioned how Nginx and Ghost was setup
That was running version 0.9 of ghost. I finally decided to upgrade to ghost v1 (1.18 at time of writing). Ghost 1.x is described as a major upgrade, with many breaking changes. There is no real upgrade path, so you really need to start a clean new v1 install, and import your existing content.
When I initially tried the migration, it broke badly. With docker, I mounted the config directory from the host, which had the blog data and theme. The theme had broken (due to major version changes), and I could not get blog to come up. But the ain issue was that the config file had changed, and ghost was not reading it, and since I dont ghost as the main domain, but hanging off /blog, all the links were broken.
After struggling for a good few days, I finally got it to work.
docker run -d -p 4431:2368 --restart-always -v /home/yusufm/gitwork/ghost-data:/var/lib/ghost ghost
And this is how I run it now:
docker run -d --name ghost-v1-13 -p 4431:2368 --restart always -v /home/yusufm/gitwork/ghost-data-v1:/var/lib/ghost/content -e url=http://gcp.hacksaw.co.za/blog/ ghost
which looks like this:
yusufm@hacksaw-1:~/gitwork$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
132bf4c26c5e ghost "docker-entrypoint..." 5 seconds ago Up 3 seconds 0.0.0.0:4431->2368/tcp ghost-v1-13
The main changes are
/var/lib/ghost
has changed to /var/lib/ghost/content
/blog
Btw, I now use --name
to specify the container name, rather than an auto-generated random container name
These were very helpfull posts:
ghost:1-alpine
. The normal ghost will work as well, alpine is smaller and lightweightrun
as above/blog
to the docker portThe bad part is that the config file is in the container, and not on the host, which means its not persistent. But since I only needed to change the URL, and I am doing it in the docker run command, its not too bad.
TODO:
Use the docker compose to specify the config file location