-
-
Notifications
You must be signed in to change notification settings - Fork 52
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 #886
Add docker compose #886
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a suggestion on overall direction. Also, can you add better instructions to the PR description? I assume this is meant to be run via ./scripts/docker-compose.sh
and not docker-compose -f docker-compose.yml up -d
? Is this typical? I'd like to follow what other projects do for consistency. I don't use Compose enough to have any real opinion, but this seems atypical to what I've seen with other Compose implementations for self-hosting.
I would prefer to do away with the docker compose run -i --rm web bundle exec rails keygen:setup I also want to do away with all hard-coded passwords in And if we're going to go the route of a We should also not have a default for The message after Then we can also instruct migrations and seeds to be run before each deployment, similarly to the docker compose run --rm web bundle exec rails db:migrate db:seed Overall, I want to avoid footguns here — people using Compose want simple/safe. wdyt? |
Sounds good, I initially went with 1 click setup as I wanted it to be as frictionless as possible. Also good idea to cover all ENV vars will do that. |
To set it up you'd run it like this.
|
14c14f9
to
375ed14
Compare
Pushed and squashed |
f2ebe5e
to
c82b753
Compare
Could we update this message to something along the lines of this?
|
@ezekg |
It's fine to display all vars. If the user has already set them, the values won't be overridden so it will just print current vals. |
Also —one final ask: is there a way to add Caddy into this to automatically handle TLS and reverse-proxy side of things? 🙂 Ideally, it'd reverse-proxy all domains in |
I'd figured since we're keeping it less opinionated it might be better off to leave that to user? Let me know what you think. |
Looks like current file is already printing all the variables however we could change this part
to if we're inside docker container set by
|
I think it's fine to have Caddy be the default here. People can always modify the compose file to use Nginx or Apache. But Caddy gives the 99% an easy way to get a reverse-proxy and TLS set up with minimal effort. This is a big pain point for people not super knowledgeable in networking when it comes to self-hosting Keygen CE. I'm all for doing things the Rails way — sensible defaults, config when needed.
I want to change it to a more general: "Then start the web and worker processes." as I mentioned above. I also want to adjust wording and format to match what I showed above so that it's more generalized: -To complete setup, run the following in a shell, or add it to a shell profile:
+To complete setup, add the following env vars in your shell or to .env:
- export SECRET_KEY_BASE=xxx
- export ENCRYPTION_DETERMINISTIC_KEY=xxx
- export ENCRYPTION_PRIMARY_KEY=xxx
- export ENCRYPTION_KEY_DERIVATION_SALT=xxx
- export KEYGEN_EDITION=CE
- export KEYGEN_MODE=singleplayer
- export KEYGEN_HOST=licensing.example.com
- export KEYGEN_ACCOUNT_ID=xxx
+ SECRET_KEY_BASE=xxx
+ ENCRYPTION_DETERMINISTIC_KEY=xxx
+ ENCRYPTION_PRIMARY_KEY=xxx
+ ENCRYPTION_KEY_DERIVATION_SALT=xxx
+ KEYGEN_EDITION=CE
+ KEYGEN_MODE=singleplayer
+ KEYGEN_HOST=licensing.example.com
+ KEYGEN_ACCOUNT_ID=xxx
In addition, you may want to keep track of the following information:
Account ID: xxx
Account slug: me
Admin email: [email protected]
-Then run the following to start the server:
-
- rails s
+Then start the web and worker processes.
*keygen music intensifies* |
b0d2318
to
45f0abd
Compare
ac59289
to
aefc440
Compare
df674eb
to
32d476b
Compare
@neo773 I updated the Caddy setup. I wanted to make it more production-capable out-of-the-box. wdyt? |
6207aee
to
90e77e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
This PR adds one click
docker-compose
setupa.mp4
/claim #727
/closes #727