If the title hasn’t scared you away, then welcome!
Over the weekend I was struggling to get a mapped URL for a Ghost container on Reclaim Cloud resolving consistently to the main URL. While the home page worked, several subpages were defaulting to localhost:2386,
which is hardcoded in the config.production.json file
.* This is where that URL is normally defined, but Docker environmental variables are not actually read through this file, which is a bit of abstraction you have to wrap your head around when working with Docker. That file will work consistently if it’s hosted on a stack, but in a Docker container you need an environmental variable file (or .env file). Another detail discovered on my journey towards understanding Docker. Thankfully I have Taylor Jadin to think this stuff through with now given he’s a bit further ahead in his grasp of containers and has played with Reclaim Cloud a fair bit.
So, the proper way to deal with this issue in Reclaim Cloud is to add the url variable to the container environment. In the Ghost application container go to Additional Settings –> Variables:
From there click on the green Add button:
After that you need to add the url variable as illustrated below (keep in mind url needs to be lowercase):
This will ensure your environment loads cleanly over a mapped domain, and all references to the domain url are updated throughout the container. Be sure to restart the application container (not the load balancer) and give it a minute or so and the site will come back up.
This solution helped me stop using the hack of cloning the site with an edited url field in the config.production.json
file to fix the issue, while also solving my adjacent issue with setting the Newsletter/Support emails. I’ll write more on that in my next post about Setting Up Email for a Ghost Newsletter.
Another variable I added to my Ghost container was mail__from
-you can see an example of this above for the address ghost_at_bavatuesdays.com.
________________________
*This file is found in the var/lib/ghost/ directory of the official Ghost Docker image.
???
I think we may want to eventually do a take 2 on the installing Ghost on Reclaim Cloud video, informed by what we learn with the newsletter over time. Installing ghost using the official docker container uses so much fewer resources than the Marketplace installer that once we know we have a good understanding of all the little facets (installing, upgrading over time etc.) I think I’d suggest most people go the Docker route.
Oh no my emojii show up as question marks! those are supposed to be thumbs up emojii!
I’ll thumbs up you commenting here, and I agree with you on Docker, it seems the way to go long term given the old app stack I installed last year on Reclaim Cloud is not really tenable with no clear way to upgrade anymore. And with my recent struggles with Mattermost from the marketplace, I am re-thinking some of that more generally.
I am definitely game for a redo on the guide for installing Docker given it has been an awesome occasion to figure some of this out.
Pingback: Configuring Email for a Ghost Docker Container on Reclaim Cloud | bavatuesdays
Pingback: bavaweekly 1-18-2022 | bavatuesdays
Hi, How do I configure SMTP details for mailgun using environment variables?
Aliya,
See this post, it should answer that question:
https://bavatuesdays.com/configuring-email-for-a-ghost-docker-container-on-reclaim-cloud/