mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-22 08:40:03 +01:00
0004e2ef9d
* platformize * Deploy to platform button * platformize * correct celery command * use project entropy so we are production ready * This can be a diskless app * prettier on a single line * add README.md * revert change to main README.md * move secret to .environment
2.2 KiB
2.2 KiB
PostHog for Platform.sh
This template builds PostHog on Platform.sh, using the gunicorn application server. In the deployment process you will be able to choose from multiple regions (from Australia to the US West Coast) with strict data locality guarantees which could help you with latency as well as GDPR, German BDSG, Canadian PIPEDA, and the Australian Privacy Act compliance.
Services
- Python 3.8
- PostgreSQL 12.X
- Persistent Redis 5.x
Customizations
The following files have been added to a basic PostHog configuration.
- The
.platform/applications.yaml
,.platform/services.yaml
, and.platform/routes.yaml
and.environment
files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit.
Some specific configuration options you may want to notice:
- In
.platform/applications.yaml
theworkers.worker.commands.start
the option--concurrency=2
controls the concurrency of the celery workers on a production system, depending on the amount of resources you allocate you will want to bump it higher - In
.environment
theSECRET_KEY
variable gets its value from a per-project stable generated secret. In a real production system you may want to have the value different between staging environments and the production environment - In
.platform/applications.yaml
thevariables.env.NODE_OPTIONS
withmax_old_space_size
has a magical value of 1536 this is because the build containers has 2GB of memory and would avoid getting webpack oom killed. - In
.platform/service.yaml
we allocate 2GB to the database and 0.5GB to the Redis instance, a real production system will probably require more, you have 5GB available to allocate in the base plan (and you can of course add more)