-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make production docker-compose.yml generated #1704
Conversation
CC @yakkomajuri per emails & Slack |
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.
Looks good. I would just not ignore the pre-built docker-compose.yml
so that we have a safe failover file
docker-compose-yml-gen.py
Outdated
def generate_secret_key() -> str: | ||
"""Generate securely random 50 ASCII letters and digits.""" | ||
return "".join( | ||
secrets.choice(string.ascii_letters + string.digits) for _ in range(50) | ||
) # random 50 ASCII letters and digits | ||
|
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.
💯
.gitignore
Outdated
@@ -27,3 +27,4 @@ yarn-error.log | |||
yalc.lock | |||
cypress/screenshots/* | |||
docker-compose.prod.yml | |||
docker-compose.yml |
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.
We don't want to ignore docker-compose.yml
do we? I feel like we should include a safe fail-safe docker-compose config in case someone doesn't know how to run the script to generate one.
docker-compose-yml-gen.py
Outdated
with open("docker-compose.yml", "w") as file: | ||
yaml.dump( |
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.
This could just overwrite the prebaked docker-compose.yml
that ships with the repo right?
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.
It'd be a bit more brittle, but it could
Echoing @fuziontech here - I'm up for keeping the file and just overwriting it if you run the script |
Alright, changed the approach to editing a default |
This file was removed in PostHog/posthog#1704
* Remove reference to docker-compose.proxy.yml This file was removed in PostHog/posthog#1704 * Remove reference from deploy-docker.md * minor update Co-authored-by: yakkomajuri <yakko.majuri@gmail.com>
Changes
This is a proposal to make
docker-compose.yml
configurable withdocker-compose-config.py
. As various users have various needs (for example some are hosting directly off of theposthog
Docker image, while others through a reverse proxy), the included config needs to be edited manually, which isn't really explained. With a guided config generation approach this is all smoother for the deploying user.A downside here is that this requires the external
pyyaml
, since YAML suport isn't in the Python stdlib.