databases:
  - name: mysite
    databaseName: mysite
    user: mysite
    plan: free

services:
  - type: web
    name: mysite
    runtime: docker
    dockerfilePath: ./Dockerfile
    repo: https://github.com/ryanwi/rails7-on-docker
    region: oregon
    branch: main
    plan: free
    numInstances: 1
    healthCheckPath: /up
    preDeployCommand: bin/rails db:migrate
    envVars:
      - key: PORT
        value: 3000
      - key: DATABASE_URL
        fromDatabase:
          name: mysite
          property: connectionString
      - key: SECRET_KEY_BASE
        sync: false # placeholder for a value to be added in the dashboard
      - key: REDIS_HOST
        fromService:
          type: redis
          name: lightning
          property: host # available properties are listed below
      - key: REDIS_PORT
        fromService:
          type: redis
          name: lightning
          property: port
  - type: redis
    name: lightning
    ipAllowList: # required
      - source: 0.0.0.0/0
        description: everywhere
    plan: free
