Skip to content
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

Qovery deployment #33

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Qovery deployment #33

wants to merge 2 commits into from

Conversation

palkan
Copy link
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.

None yet

1 participant