mirror of
https://github.com/usetrmnl/terminus.git
synced 2026-04-29 13:34:37 -07:00
cf67bc93a0
Necessary to ensure assets and migrations are only setup for the _web_ service. This ensures other services, like the _worker_ service, don't end up duplicating this work. The new `APP_SETUP` environment variable controls this behavior and works for both Docker and Render. The original idea stems from Max but has been modified to support both assets _and_ migrations. This also fixes a typo in the `compose.dev.yml.tt` to do not adding the end quote in the right place. Co-authored-by: Max Forasteiro <18661016+maxforasteiro@users.noreply.github.com> Milestone: minor
17 lines
393 B
Ruby
Executable File
17 lines
393 B
Ruby
Executable File
#! /usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
$VERBOSE = true
|
|
|
|
jemalloc_path = Dir["/usr/lib/*/libjemalloc.so.2"]
|
|
ENV["LD_PRELOAD"] = jemalloc_path.first unless ENV.key?("LD_PRELOAD") || jemalloc_path.empty?
|
|
|
|
if ENV["APP_SETUP"] == "true"
|
|
system "bundle exec hanami assets compile"
|
|
system "bundle exec hanami db migrate"
|
|
else
|
|
puts "Application is setup. Skipped."
|
|
end
|
|
|
|
exec(*ARGV)
|