91df76928b
The setup here is a bit rough while we settle some of the details, but the gist of it is: - Define accessories to run the primary/replica processes - Add a web-replica role, which is similar to web but has the replication-side accessory - Load the beamer extension on the app's primary tenanted database Note that we aren't sending any traffic into the replica yet, but it would be functional to do so. This stage is mainly about testing the database replication.
60 lines
1021 B
YAML
60 lines
1021 B
YAML
service: fizzy
|
|
image: basecamp/fizzy
|
|
|
|
|
|
x-basecamp-registry: &basecamp-registry
|
|
username: bcbot
|
|
password:
|
|
- BASECAMP_REGISTRY_PASSWORD
|
|
|
|
x-beamer-accessory: &beamer-accessory
|
|
image: basecamp/beamer
|
|
registry:
|
|
<<: *basecamp-registry
|
|
options:
|
|
user: 1000 # Match the UID of the Rails app, for volume permissions
|
|
volumes:
|
|
- fizzy:/storage
|
|
|
|
|
|
servers:
|
|
jobs:
|
|
cmd: bin/jobs
|
|
|
|
accessories:
|
|
beamer-primary:
|
|
<<: *beamer-accessory
|
|
service: beamer-primary
|
|
cmd: beamer primary --debug --remove-after=1h --dir=/storage
|
|
port: 5000:80
|
|
roles:
|
|
- web
|
|
|
|
beamer-replica:
|
|
<<: *beamer-accessory
|
|
service: beamer-replica
|
|
cmd: beamer replica --debug --primary=http://fizzy-app-101:5000/ --dir=/storage
|
|
roles:
|
|
- web-replica
|
|
|
|
volumes:
|
|
- fizzy:/rails/storage
|
|
|
|
proxy:
|
|
ssl: true
|
|
|
|
registry:
|
|
<<: *basecamp-registry
|
|
|
|
builder:
|
|
arch: amd64
|
|
secrets:
|
|
- GITHUB_TOKEN
|
|
|
|
env:
|
|
secret:
|
|
- SECRET_KEY_BASE
|
|
|
|
aliases:
|
|
console: app exec -i --reuse "bin/rails console"
|