Use VFS-based Beamer
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
|
||||
|
||||
|
||||
# Fetch beamer library
|
||||
FROM basecamp/beamer:latest AS beamer
|
||||
FROM basecamp/beamer:vfs AS beamer
|
||||
|
||||
|
||||
# Final stage for app image
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ test:
|
||||
production: &production
|
||||
primary:
|
||||
<<: *default
|
||||
database: storage/tenants/<%= Rails.env %>/%{tenant}/db/main.sqlite3
|
||||
database: file:storage/tenants/<%= Rails.env %>/%{tenant}/db/main.sqlite3?vfs=beamer
|
||||
tenanted: true
|
||||
extensions:
|
||||
- ./bin/lib/beamer.so
|
||||
|
||||
@@ -21,7 +21,7 @@ env:
|
||||
RAILS_ENV: staging
|
||||
|
||||
x-beamer-accessory: &beamer-accessory
|
||||
image: basecamp/beamer
|
||||
image: basecamp/beamer:vfs
|
||||
registry:
|
||||
username: bcbot
|
||||
password:
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# This is a temporary shim to load the Beamer VFS prior to opening the tenanted
|
||||
# databases that use it.
|
||||
#
|
||||
# It's here to get around the fact that the VFS needs to be registed before the
|
||||
# databases are opened, so we can't rely on the normal extension loading to do
|
||||
# it.
|
||||
#
|
||||
# We'll move this responsibility into a Beamer gem soon, at which point this
|
||||
# file will be removed.
|
||||
|
||||
Rails.application.config.after_initialize do
|
||||
beamer_extension_path = Rails.root.join("bin/lib/beamer.so")
|
||||
|
||||
if beamer_extension_path.exist?
|
||||
db = SQLite3::Database.new ":memory:"
|
||||
db.enable_load_extension(true)
|
||||
db.load_extension(beamer_extension_path)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user