Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production Dockerfile for Self Hosting #295

Closed
3 tasks
DomiiBunn opened this issue Feb 4, 2024 · 21 comments
Closed
3 tasks

Production Dockerfile for Self Hosting #295

DomiiBunn opened this issue Feb 4, 2024 · 21 comments
Labels
📆 Planned Not ready to be worked on yet, but planned for future

Comments

@DomiiBunn
Copy link

DomiiBunn commented Feb 4, 2024

Planned Work

See #295 (comment)

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:

  1. Simplifies deployment process.
  2. Mitigates potential dependency issues.
  3. 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.

@yeskiy
Copy link

yeskiy commented Feb 5, 2024

Hey! You can use devcontainer for that!

@K-J-VV
Copy link

K-J-VV commented Feb 5, 2024

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

@DomiiBunn
Copy link
Author

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.

^.^

@K-J-VV
Copy link

K-J-VV commented Feb 5, 2024

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

@yeskiy
Copy link

yeskiy commented Feb 5, 2024

@DomiiBunn, @K-J-VV please follow #306. This Issue (and pr) contains some changes that you requested.

@DomiiBunn
Copy link
Author

DomiiBunn commented Feb 5, 2024

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.

@DomiiBunn
Copy link
Author

I can take up creation of the compose, guide etc but did not want to claim your namespace on dockerhub

@zachgoll
Copy link
Collaborator

zachgoll commented Feb 6, 2024

@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)?

@DomiiBunn
Copy link
Author

@zachgoll Yes, That was the idea.

@guillaumebriday
Copy link

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.

@DomiiBunn
Copy link
Author

More of a question to the devs with the above ^.^

@indykoning
Copy link

#327 should help with the public image part

@zachgoll
Copy link
Collaborator

zachgoll commented Feb 6, 2024

@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!

@thomas-mc-work
Copy link

@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).

@DomiiBunn
Copy link
Author

@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.

@jinnabaalu
Copy link

Create the docker compose with maybe docker image and postgres container #416

We still need to solve the problem of pushing the docker image to gcr.

@jinnabaalu
Copy link

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 #416

@zachgoll
Copy link
Collaborator

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:

I will post an update directly to this issue when it is ready to be worked on!

@zachgoll zachgoll added the 📆 Planned Not ready to be worked on yet, but planned for future label Feb 22, 2024
@zachgoll zachgoll changed the title Easy deployment using docker Production Dockerfile for Self Hosting Feb 22, 2024
@haydenk
Copy link

haydenk commented Feb 22, 2024

Re: #308 - I would consider splitting into two variables, FORCE_SSL and ASSUME_SSL, instead of a single variable that affects both configuration options.

@corsonknowles
Copy link
Contributor

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

@zachgoll
Copy link
Collaborator

Detailed requirements have been written for this. Closing this issue out as it has been superseded by #627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📆 Planned Not ready to be worked on yet, but planned for future
Projects
None yet
Development

No branches or pull requests

10 participants