Unify docker images `prisma` and `prisma-prod`
Is your feature request related to a problem? Please describe. We have 2 different images for local prisma and actual production deployments. The difference between those are:
- the prod image can disable the Management API by setting
managementApiEnabled: falsein the server config - the prod image always tries to connect to a RabbitMQ specified by the
rabbitUriproperty.
Describe the solution you'd like We should only have one Prisma image that:
- respects the
managementApiEnabledsetting - decides whether to use RabbitMQ or not depending on the presence of the
rabbitUriproperty.
Describe alternatives you've considered None
Additional context I stumbled upon this issue while i advised people on a production setup for Prisma in this issue. They were trying to disable the Management API for the local image which was not possible.
@mavilein - This would indeed be easier to understand.
I have two followup questions:
- Are there any other differences between the two?
- Do you not recommend using
prismain production (when protected by a management API secret)? If not, how come?
@jhalborg:
- The differences i described are the only ones.
- If you want to setup a horizontally scalable setup you should not use
prismabut theprisma-prodimage. The reason is that only one management API must be active in a cluster of servers. Therefore we you must run exactly one instance of Prisma with the management API enabled and an arbitrary number of instances with the management API disabled. We call those primary and secondary instances.
@mavilein Do we still need to use prisma-prod?
decides whether to use RabbitMQ or not depending on the presence of the rabbitUri property
If we have 1 "primary service" for deployments (managementApiEnabled: true) and 1 "secondary service" for actual requests (managementApiEnabled: false), do we need RabbitMQ? Will the secondary server notice schema changes without it?
@frandiox : Yes you need it. The RabbitMQ is used to propagate datamodel changes from the management server to secondary ones.
That aside we are currently working on removing the need for RabbitMQ with Prisma 2.
@mavilein I'm creating an Helm chart for Prisma-Prod.
I was looking for the Dockefile that generates the -heroku suffix.
Due to secrets handlinkg in kubernets I would need a pruduction like docker image with the -heroku suffix:
https://github.com/helm/charts/issues/13530#issuecomment-570154690
Unfortunatly I didn't find anything on this repo, I would create my own production like image with the heroku env handling.