Added docker compose file to make bringing up/down the services easier; modified puma config to be more efficient
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine
2026-07-24 12:52:57 -04:00
parent d526fa30f4
commit 22dd3bca3e
2 changed files with 45 additions and 5 deletions
+22 -5
View File
@@ -1,11 +1,28 @@
app_dir = File.expand_path('..', __dir__)
directory app_dir
# load puma config from environment variables
environment ENV.fetch('RACK_ENV', 'development')
require_relative '../src/config'
conf = Config.new()
# listening address
host = ENV.fetch('BIND_HOST', '0.0.0.0')
port = ENV.fetch('PORT', 9292)
bind "tcp://#{host}:#{port}"
bind "tcp://#{conf.get('server.host')}:#{conf.get('server.port')}"
workers 2
threads 1, 5
# Concurrency tuning
workers_count = ENV.fetch('WEB_CONCURRENCY', 2).to_i
workers workers_count
max_threads_count = ENV.fetch('PUMA_MAX_THREADS', ENV.fetch('RAILS_MAX_THREADS', 5)).to_i
min_threads_count = ENV.fetch('PUMA_MIN_THREADS', ENV.fetch('RAILS_MIN_THREADS', 1)).to_i
threads min_threads_count, max_threads_count
# Preload app code before forking worker processes for better memory usage (Copy-on-Write)
if workers_count > 0
preload_app!
before_fork do
# Disconnect Sequel connection pool in the master process before forking
DB.disconnect if defined?(DB)
end
end
+23
View File
@@ -0,0 +1,23 @@
services:
game-data:
build:
context: .
dockerfile: Dockerfile.dev
image: game-data
container_name: game-data
ports:
- "9292:9292"
volumes:
- .:/usr/src/game-data
tty: true
game-data-gulp:
build:
context: .
dockerfile: Dockerfile.gulp
image: game-data-gulp
container_name: game-data-gulp
volumes:
- .:/usr/src/game-data
tty: true
command: npm run gulp watch