2022-05-21 15:41:17 +00:00
|
|
|
databases:
|
|
|
|
- name: srv.postgres
|
2022-05-25 23:31:51 +00:00
|
|
|
plan: pro plus
|
2022-05-21 15:41:17 +00:00
|
|
|
user: apollo
|
|
|
|
databaseName: apollo
|
|
|
|
postgresMajorVersion: 14
|
|
|
|
ipAllowList: [] # only allow internal connections
|
|
|
|
|
|
|
|
services:
|
|
|
|
# Redis
|
|
|
|
- type: redis
|
|
|
|
name: srv.redis
|
|
|
|
plan: pro
|
|
|
|
maxmemoryPolicy: noeviction
|
|
|
|
ipAllowList: [] # only allow internal connections
|
|
|
|
|
|
|
|
# PGBouncer
|
2022-05-21 16:09:16 +00:00
|
|
|
- type: pserv
|
2022-05-21 15:41:17 +00:00
|
|
|
name: srv.pgbouncer
|
|
|
|
env: docker
|
|
|
|
plan: standard
|
|
|
|
repo: https://github.com/renderinc/docker-pgbouncer.git
|
|
|
|
envVars:
|
|
|
|
- key: ADMIN_USERS
|
|
|
|
value: postgres,apollo
|
|
|
|
- key: DATABASE_URL
|
|
|
|
fromDatabase:
|
|
|
|
name: srv.postgres
|
|
|
|
property: connectionString
|
|
|
|
- key: DEFAULT_POOL_SIZE
|
|
|
|
value: 128
|
|
|
|
- key: MAX_CLIENT_CONN
|
|
|
|
value: 1024
|
|
|
|
- key: MIN_POOL_SIZE
|
|
|
|
value: 8
|
|
|
|
- key: POOL_MODE
|
|
|
|
value: transaction
|
|
|
|
- key: RESERVE_POOL_TIMEOUT
|
|
|
|
value: 1
|
|
|
|
- key: SERVER_RESET_QUERY
|
|
|
|
value: DISCARD ALL
|
|
|
|
|
|
|
|
# StatsD
|
2022-05-21 16:09:52 +00:00
|
|
|
- type: pserv
|
|
|
|
name: srv.statsd
|
2022-05-21 15:41:17 +00:00
|
|
|
env: docker
|
|
|
|
plan: standard
|
|
|
|
repo: https://github.com/andremedeiros/render-datadog.git
|
|
|
|
envVars:
|
|
|
|
- key: DD_API_KEY
|
|
|
|
sync: false
|
|
|
|
- key: DD_APM_ENABLED
|
|
|
|
value: false
|
|
|
|
- key: DD_LOG_LEVEL
|
|
|
|
value: ERROR
|
|
|
|
|
|
|
|
# API
|
|
|
|
- type: web
|
|
|
|
name: web.api
|
|
|
|
env: go
|
|
|
|
plan: standard
|
|
|
|
healthCheckPath: /v1/health
|
|
|
|
envVars:
|
|
|
|
- fromGroup: env-settings
|
2022-05-21 16:07:21 +00:00
|
|
|
- key: BUGSNAG_APP_TYPE
|
|
|
|
value: api
|
2022-05-21 15:41:17 +00:00
|
|
|
scaling:
|
2022-06-25 18:01:03 +00:00
|
|
|
minInstances: 2
|
|
|
|
maxInstances: 4
|
2022-05-21 15:41:17 +00:00
|
|
|
targetCPUPercent: 60
|
|
|
|
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
|
|
|
|
startCommand: panic-monitor ./apollo api
|
|
|
|
|
|
|
|
# Notifications
|
|
|
|
- type: worker
|
|
|
|
name: worker.notifications
|
|
|
|
env: go
|
|
|
|
plan: starter plus
|
|
|
|
envVars:
|
|
|
|
- fromGroup: env-settings
|
2022-05-21 16:07:21 +00:00
|
|
|
- key: BUGSNAG_APP_TYPE
|
|
|
|
value: worker
|
|
|
|
- key: BUGSNAG_METADATA_QUEUE
|
|
|
|
value: notifications
|
2022-05-21 15:41:17 +00:00
|
|
|
scaling:
|
2022-05-23 19:53:01 +00:00
|
|
|
minInstances: 2
|
|
|
|
maxInstances: 20
|
2022-05-21 15:41:17 +00:00
|
|
|
targetCPUPercent: 75
|
|
|
|
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
|
|
|
|
startCommand: panic-monitor ./apollo worker --queue notifications --multiplier 64
|
|
|
|
|
|
|
|
# Stuck Notifications Checker
|
|
|
|
- type: worker
|
|
|
|
name: worker.notifications.stuck
|
|
|
|
env: go
|
|
|
|
plan: starter plus
|
|
|
|
envVars:
|
|
|
|
- fromGroup: env-settings
|
2022-05-21 16:07:21 +00:00
|
|
|
- key: BUGSNAG_APP_TYPE
|
|
|
|
value: worker
|
|
|
|
- key: BUGSNAG_METADATA_QUEUE
|
|
|
|
value: stuck
|
2022-05-21 15:41:17 +00:00
|
|
|
scaling:
|
|
|
|
minInstances: 1
|
|
|
|
maxInstances: 10
|
|
|
|
targetCPUPercent: 75
|
|
|
|
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
|
|
|
|
startCommand: panic-monitor ./apollo worker --queue stuck-notifications --multiplier 64
|
|
|
|
|
|
|
|
# Scheduler
|
|
|
|
- type: worker
|
|
|
|
name: app.scheduler
|
|
|
|
env: go
|
|
|
|
plan: starter
|
|
|
|
envVars:
|
|
|
|
- fromGroup: env-settings
|
2022-05-21 16:07:21 +00:00
|
|
|
- key: BUGSNAG_APP_TYPE
|
|
|
|
value: scheduler
|
2022-05-21 15:41:17 +00:00
|
|
|
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
|
|
|
|
startCommand: panic-monitor ./apollo scheduler
|
|
|
|
|
|
|
|
# User Watcher
|
|
|
|
- type: worker
|
|
|
|
name: worker.watcher.users
|
|
|
|
env: go
|
|
|
|
plan: starter
|
|
|
|
envVars:
|
|
|
|
- fromGroup: env-settings
|
2022-05-21 16:07:21 +00:00
|
|
|
- key: BUGSNAG_APP_TYPE
|
|
|
|
value: worker
|
|
|
|
- key: BUGSNAG_METADATA_QUEUE
|
|
|
|
value: users
|
2022-05-21 15:41:17 +00:00
|
|
|
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
|
|
|
|
startCommand: panic-monitor ./apollo worker --queue users --multiplier 16
|
|
|
|
|
|
|
|
# Subreddit Watcher
|
|
|
|
- type: worker
|
|
|
|
name: worker.watcher.subreddits
|
|
|
|
env: go
|
|
|
|
plan: starter plus
|
|
|
|
envVars:
|
|
|
|
- fromGroup: env-settings
|
2022-05-21 16:07:21 +00:00
|
|
|
- key: BUGSNAG_APP_TYPE
|
|
|
|
value: worker
|
|
|
|
- key: BUGSNAG_METADATA_QUEUE
|
|
|
|
value: subreddits
|
2022-05-21 15:41:17 +00:00
|
|
|
scaling:
|
|
|
|
minInstances: 1
|
|
|
|
maxInstances: 10
|
|
|
|
targetCPUPercent: 75
|
|
|
|
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
|
|
|
|
startCommand: panic-monitor ./apollo worker --queue subreddits --multiplier 64
|
|
|
|
|
|
|
|
# Trending Posts Watcher
|
|
|
|
- type: worker
|
|
|
|
name: worker.watcher.trending
|
|
|
|
env: go
|
|
|
|
plan: starter plus
|
|
|
|
envVars:
|
|
|
|
- fromGroup: env-settings
|
2022-05-21 16:07:21 +00:00
|
|
|
- key: BUGSNAG_APP_TYPE
|
|
|
|
value: worker
|
|
|
|
- key: BUGSNAG_METADATA_QUEUE
|
|
|
|
value: trending
|
2022-05-21 15:41:17 +00:00
|
|
|
scaling:
|
|
|
|
minInstances: 1
|
|
|
|
maxInstances: 10
|
|
|
|
targetCPUPercent: 75
|
|
|
|
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
|
|
|
|
startCommand: panic-monitor ./apollo worker --queue trending --multiplier 64
|
|
|
|
|
|
|
|
envVarGroups:
|
|
|
|
# Environment
|
|
|
|
- name: env-settings
|
|
|
|
envVars:
|
|
|
|
- key: APPLE_KEY_ID
|
|
|
|
sync: false
|
|
|
|
- key: APPLE_KEY_PATH
|
|
|
|
value: /etc/secrets/apple.p8
|
|
|
|
- key: APPLE_TEAM_ID
|
|
|
|
sync: false
|
|
|
|
- key: BUGSNAG_API_KEY
|
|
|
|
sync: false
|
|
|
|
- key: DD_API_KEY
|
|
|
|
sync: false
|
|
|
|
- key: ENV
|
|
|
|
sync: false
|
|
|
|
- key: REDDIT_CLIENT_ID
|
|
|
|
sync: false
|
|
|
|
- key: SMTP2GO_API_KEY
|
|
|
|
sync: false
|
|
|
|
- key: STATSD_URL
|
|
|
|
sync: false
|
2022-05-21 17:21:24 +00:00
|
|
|
- key: DATABASE_CONNECTION_POOL_URL # This is temporary and should be overwritten
|
|
|
|
sync: false
|
|
|
|
- key: STATSD_URL
|
|
|
|
sync: false
|
|
|
|
- key: REDIS_URL
|
|
|
|
sync: false
|