Prod build process

This commit is contained in:
Jason Jordan
2026-05-06 13:28:16 -04:00
parent 1d9025276d
commit e0101be567
223 changed files with 1861 additions and 7105 deletions
Regular → Executable
+9 -3
View File
@@ -2,14 +2,20 @@
set -e
printenv >> /etc/environment
# printenv >> /etc/environment
# echo "updating cron..."
# bundle exec whenever > crontab
# echo "starting cron..."
# supercronic /rails/crontab
echo "updating cron..."
bundle exec whenever --update-crontab --set environment=development
bundle exec whenever --update-crontab
# Start cron in foreground
echo "starting cron..."
cron
cron -f
# bundle exec whenever --update-crontab
# Then exec the container's main process (what's set as CMD in the Dockerfile).
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
+11 -7
View File
@@ -1,23 +1,27 @@
#!/bin/bash -e
set -e
# Enable jemalloc for reduced memory usage and latency.
if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)"
fi
# This prevents "A server is already running" errors if a previous container crashed.
if [ -f tmp/pids/server.pid ]; then
rm -f tmp/pids/server.pid
fi
# NOTE: Enable this as you need to get migrations working in your deployed
# (i.e. Production) environments. Match the condition check to what you have in
# the Dockerfile CMD. I use puma in the production.Dockerfile as that's the
# recommended option by the Puma team (https://github.com/puma/puma#rails), but
# the default Rails Dockerfile uses `./bin/rails server`
# echo "${1}"
# echo "${2}"
# echo "${3}"
echo "starting puma server..."
# # If running the rails server then create or migrate existing database
# if [ "${1}" == "bundle" ] && [ "${2}" == "exec" ] && [ "${3}" == "puma" ]; then
# ./bin/rails db:prepare
# fi
# If running the rails server then create or migrate existing database
if [ "${1}" == "bundle" ] && [ "${2}" == "exec" ] && [ "${3}" == "puma" ]; then
./bin/rails db:migrate
fi
exec "${@}"
Regular → Executable
View File
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
# printenv >> /etc/environment
echo "starting jobs..."
# bin/jobs start
bundle exec bin/delayed_job run
# Then exec the container's main process (what's set as CMD in the Dockerfile).
exec "$@"
Regular → Executable
View File