Skip to content

Qovery deployment#33

Draft
palkan wants to merge 2 commits intomasterfrom
demo/qovery
Draft

Qovery deployment#33
palkan wants to merge 2 commits intomasterfrom
demo/qovery

Conversation

@palkan
Copy link
Copy Markdown
Member

@palkan palkan commented Sep 22, 2023

Description

This PR contains code changes and describes the required steps to deploy a Rails application with AnyCable on Qovery (full mode, with gRPC service).

Changes

  • Added Dockerfile
    • Not production ready The dockerfile is based on our development Dockerfile and is not optimized for production
    • We assume that you have your own Dockerfile (or use something like dockerfile-rails, or Rails 7.1 built-in template)
    • The only important piece of the Dockerfile is the usage of bin/docker-entrypoint script as an entrypoint (it's borrowed from Rails)
  • Minor production configuration changes (e.g., sharing cookies across subdomains to make authentication work with two hostnames, web and ws).

Qovery tips

We tested our setup using Qovery playground cluster. The resulting formation is depicted below:

image

The web service is the default Rails web service.

The rpc service is a clone of the web service with the following changes:

  • "CMD arguments" are set to ["bundle","exec","anycable","--rpc-host","0.0.0.0:50051"] (to run AnyCable RPC server)
  • Port is changed to 50051 GRPC
  • gRPC healthchecks are configured for 50051 (Service: anycable.RPC)

The ws service is deployed directly from Dockerhub:

  • Healthchecks are configured to use the /health HTTP endpoint.

The following environment variables have been set to connect services and databases:

  • DATABASE_URL as an alias for QOVERY_POSTGRESQL_<XXX>_DATABASE_URL_INTERNAL (scope: Application)

  • REDIS_URL as an alias for QOVERY_REDIS_<XXX>_DATABASE_URL_INTERNAL (scope: Application)

  • APPLICATION_RPC_HOST_INTERNAL as an alias for QOVERY_APPLICATION_<RPC_SERVICE_ID>_HOST_INTERNAL (scope: Environment)

  • APPLICATION_WS_HOST_EXTERNAL as an alias for QOVERY_APPLICATION_<WS_SERVICE_ID>_HOST_EXTERNAL (scope: Environment)

  • CABLE_URL as wss://${APPLICATION_WS_HOST_EXTERNAL}/cable (scope: Environment)

  • ANYCABLE_RPC_HOST as {{APPLICATION_RPC_HOST_INTERNAL}}:50051 (scope: Service, ws)

  • ANYCABLE_HOST=0.0.0.0 (scope: Service, ws)

- Qovery allows sharing cookie across subdomains at .qovery.fr
- Configure public/ headers
@palkan palkan added the demo Demo branch PR label Sep 22, 2023
@palkan palkan force-pushed the master branch 2 times, most recently from 2e4efd0 to 7b2111f Compare April 2, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

demo Demo branch PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant