maybe
maybe copied to clipboard
Production Dockerfile for Self Hosting
Planned Work
See https://github.com/maybe-finance/maybe/issues/295#issuecomment-1959490796
- [ ] Build an "all in one" Dockerfile that can run the app on a single VPS
- [ ] Build a Github action that pushes the Dockerfile to ghcr as scaffolded out in both #416 and in #327
- [ ] Implement SSL config change from discussion in #308
An update will be posted directly to this issue when it is ready to be worked on!
Original Issue
Issue Description:
Background: Currently, it seems that the development is in its early stages. While acknowledging this, I believe that having a public Docker image along with a Docker Compose example could be beneficial for the community.
Proposal: I suggest creating and sharing a public Docker image for easier deployment. Additionally, including a Docker Compose example would facilitate users in setting up the environment seamlessly, potentially reducing future dependency-related issues.
Benefits:
- Simplifies deployment process.
- Mitigates potential dependency issues.
- Enhances user experience and accessibility.
Considerations:
- Ensure documentation is comprehensive for both the Docker image and Docker Compose setup.
- Set up a CI to deply the Docker image as updates are made.
Note: I understand that this might be premature in the development phase, but planning for this inclusion could prove valuable in the long run.
Hey! You can use devcontainer for that!
Would you consider eventually uploading & releasing images for those less-savvy Githubers? As @DomiiBunn said, it would simplify deployment & increase accessibility
e.g., ghcr.io/maybe-finance/maybe:latest
My exact point ^
I spun it up with devcontainer but I think people would rather coppy a docker-compose file. change some env vars and do docker compose up
rather than clonning a reppo and seting up with dev containers.
^.^
My exact point ^
I spun it up with devcontainer but I think people would rather coppy a docker-compose file. change some env vars and do
docker compose up
rather than clonning a reppo and seting up with dev containers.^.^
I can absolutely vouch as being a person who would rather use a docker-compose file. I consider myself a creative homelaber, not at all a developer/coder. I'm sure I can figure out how to clone a reppo but am entirely dependent on trying out new projects from available images, customizing env variables, & then updating my tags as new releases are published
@DomiiBunn, @K-J-VV please follow #306. This Issue (and pr) contains some changes that you requested.
~The point beeing made is not for development but for deployment.~
(Also windows isn't related for this issue afaik)
Edit:
I didn't notice the docker-compose included. It still does not deploy the aplication in producction. Maybe rename it to docker-compose-develop instead? As it only provides the postgres and redis service.
I can take up creation of the compose, guide etc but did not want to claim your namespace on dockerhub
@DomiiBunn just to clarify, this proposal is to bundle up all the required services into a single Dockerfile that could be deployed to a VPS for the purpose of self-hosting (rather than development)?
@zachgoll Yes, That was the idea.
Would you be interested if I open a PR following the configuration in https://guillaumebriday.fr/how-to-deploy-rails-with-kamal-postgresql-sidekiq-and-backups-on-a-single-host?
That would avoid the need to publish and maintain a public image in the mean time 👍 and allow developer to deploy their own version of Maybe.
More of a question to the devs with the above ^.^
#327 should help with the public image part
@guillaumebriday appreciate the guide; I think we'll want to hold off on this for the moment since we're still so early with development and want to keep the focus there.
Definitely a future priority though. Kamal is likely what we'll go with eventually, but for now, we're trying to keep things as simple as possible.
Keep an eye on this guide for now—https://github.com/maybe-finance/maybe/wiki/Self-Hosting-Setup-Guide
We will be sure to update it along with adding scoped issues for making it happen once we get closer to a first release!
@DomiiBunn just to clarify, this proposal is to bundle up all the required services into a single Dockerfile that could be deployed to a VPS for the purpose of self-hosting (rather than development)?
While I appreciate the first part I think the second one (single Dockerfile) is a misconception. A Dockerfile should consist of only one service. And a combination (e.g. with a database) is then realized by Docker Compose (as you already do for the dev setup).
@thomas-mc-work
I mistread their comment, In the initial issue though...
Ensure documentation is comprehensive for both the Docker image and Docker Compose setup.
Create the docker compose with maybe docker image and postgres container https://github.com/maybe-finance/maybe/pull/416
We still need to solve the problem of pushing the docker image to gcr.
Created the github action to push the docker image to ghcr, now the image will be available ghcr.io/maybe-finance/maybe:latest
Here is the PR https://github.com/maybe-finance/maybe/pull/416
While we're still a bit early for a production-ready Dockerfile, this issue is definitely in line with our priorities so I will mark it as planned. The tasks that this issue will cover addresses several comments made here, in #308, and across various PRs:
- [ ] Build an "all in one" Dockerfile that can run the app on a single VPS
- [ ] Build a Github action that pushes the Dockerfile to ghcr as scaffolded out in both #416 and in #327
- [ ] Implement SSL config change from discussion in #308
I will post an update directly to this issue when it is ready to be worked on!
Re: #308 - I would consider splitting into two variables, FORCE_SSL and ASSUME_SSL, instead of a single variable that affects both configuration options.
Recommending we may want to move to the "most official" Ruby images. Looks like we picked up slim
from the Rails default dockerfile. Here's what Dockerhub has to say about this line of images:
That means, using ruby:<version>
rather than ruby:<version>-slim
ruby:
-slim This image does not contain the common packages contained in the default tag and only contains the minimal packages needed to run ruby. Unless you are working in an environment where only the ruby image will be deployed and you have space constraints, we highly recommend using the default image of this repository.
https://hub.docker.com/_/ruby
Detailed requirements have been written for this. Closing this issue out as it has been superseded by #627