-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add Docker Compose support #727
Comments
The setup step in particular makes a one-command docker-compose tough. But open to suggestions. Since docker-compose isn't commonly used in production, it isn't a high priority for me to implement myself. I'd of course be open to a PR, though! |
I'm also wondering this. This is the closest I got, but I'm still working through setting it up in a dev environment. It requires you allowing |
The setup Rake task is mainly an interactive way to seed the database, and create an account and an initial admin. It also makes sure required environment variables are set, such as environment variables for Rails internals and for at-work encryption. But granted you already have all of that, I'm fine with an option to bypass the setup Rake task entirely. Bypassing the setup sounds like it'd work nicely for docker-compose. I'm thinking maybe add the account and admin creation to Something like this in # file: db/seeds.rb
# ...
if ENV.key?('KEYGEN_ACCOUNT_ID') && ENV.key?('KEYGEN_ADMIN_EMAIL') && ENV.key?('KEYGEN_ADMIN_PASSWORD')
id = ENV.fetch('KEYGEN_ACCOUNT_ID')
Account.find_or_create_by!(id:) do |account|
email = ENV.fetch('KEYGEN_ADMIN_EMAIL')
password = ENV.fetch('KEYGEN_ADMIN_PASSWORD')
account.assign_attributes(
billing_attributes: { state: 'subscribed' },
users_attributes: [{ email:, password: }],
protected: true,
)
end
end Since |
Any plans to get this in @ezekg? We want to host this on Kubernetes and automated setup would be extremely helpful. |
No official plans, but open to a PR. |
(Reposted since I used the wrong github account) Copy .env and docker-compose.yml from below and run this command.
The output might be something like:
Make sure to copy it all (without "export ") into .config/keygen.env, and uncomment web/worker section from docker-compose.yml and re-run. .env
.config/keygen.env (Put those EXPORTs and other environment variables in here)
docker-compose.yml
|
I create an example here: https://github.com/derekhe/keygen-docker-compose |
Looping in keygen-sh/community#77 (comment):
|
Also see the notice here: https://keygen.sh/docs/self-hosting/#configure-keygen
You can supply all of these env vars during an out-of-band |
/bounty $200 |
💎 $200 bounty • KeygenSteps to solve:
Thank you for contributing to keygen-sh/keygen-api! Add a bounty • Share on socials
|
💡 @neo773 submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
We have an official Compose file now: https://github.com/keygen-sh/keygen-api/blob/master/docker-compose.yaml docker-compose --profile setup run --rm setup
docker-compose up lmk your thoughts and feedback. |
🎉🎈 @neo773 has been awarded $200! 🎈🎊 |
I'm considering adding Keygen to our small business. I've just read the self-host documentation and, although the solution is based on Docker, there is no mention of how to make an optimal setup with Docker Compose. I.e., you have to have Postgres, Redis and stuff outside Docker or separately add those containers on your own.
Would be nice to have a Compose example if you at Keygen use it yourselves.
The text was updated successfully, but these errors were encountered: