Skip to content

Latest commit

 

History

History
78 lines (63 loc) · 1.96 KB

deployment.md

File metadata and controls

78 lines (63 loc) · 1.96 KB

Deployment

This repo is set up to be deployed to Railway

Prerequisites

Create Sentry projects

  • Fastify based project for server
  • React based project for web

Before deployment

  • Update app name in package.json
  • Update SENTRY_PROJECT environment variables

Deploying to Railway

1. GitHub

  • create production environment if it doesn't exist
  • add these 2 secrets
    • SENTRY_AUTH_TOKEN
    • SENTRY_ORG

2. Railway

  • create a new empty project
  • add a service -> GitHub -> putting-pals
    • rename to server
    • add variables including postgres reference
      PORT="4000"
      ORIGIN="https://puttingpals.conorob.me"
      SENTRY_DSN="https://[email protected]/789"
    • update settings
      • railway config file apps/server/railway.json
      • region
      • resource limits
  • add a service -> GitHub -> putting-pals
    • rename to web
    • add variables
      PORT="3000"
      SENTRY_DSN="https://[email protected]/789"
    • update settings
      • railway config file apps/web/railway.json
      • region
      • resource limits
  • add a service -> GitHub -> putting-pals
    • rename to proxy
    • add variables
      WEB_DOMAIN="${{web.RAILWAY_PRIVATE_DOMAIN}}"
      WEB_PORT="${{web.PORT}}"
      SERVER_DOMAIN="${{server.RAILWAY_PRIVATE_DOMAIN}}"
      SERVER_PORT="${{server.PORT}}"
    • update settings
      • railway config file apps/proxy/railway.json
      • region
      • resource limits
      • add a custom subdomain on port 8080 and copy the domain provided abc123.up.railway.app

3. Cloudflare

  • Create a new DNS CNAME record
  • Add the subdomain created in Railway
  • Add the target provided by Railway abc123.up.railway.app
  • Enable Cloudflare proxy
  • Set SSL/TLS mode to Full (Strict)

4. Validation

  • Open Network tab in Chrome Dev Tools
  • You should see "Server":"cloudflare" response headers for all requests