docs/production_environment.md
This document provides guidance on setting up and configuring the production environment for Gumroad, including environment variables and running services.
Set up all environment variables listed in the .env.production.example file in your environment. These variables contain all the necessary configuration for database connections, caching, application servers, storage, payment processing, authentication, email services, and third-party integrations.
The Gumroad production environment consists of several services that work together. Below is information on how to run each service.
Gumroad uses Puma as the application server.
Puma runs the Rails application and handles HTTP requests. Configuration:
PUMA_WORKER_PROCESSES (default: 1)RAILS_MAX_THREADS (default: 2)We recommend running Nginx in front of Puma as a reverse proxy.
Sidekiq processes background jobs for the application.
RAILS_MAX_THREADS (default: 2)USE_DB_WORKER_REPLICAS=true to use read replicas for database operationsRPush handles push notifications to mobile devices.
RPUSH_REDIS_HOSTINITIALIZE_RPUSH_APPS: "true"