├── .rspec ├── .dockerignore ├── .gitignore ├── image ├── runit │ ├── nginx-term │ ├── memcached │ ├── nginx │ ├── nginx-log-forwarder │ └── redis ├── ruby_support │ ├── system-rvm-exec.sh │ ├── dpkg-control │ ├── install_ruby_utils.sh │ ├── finalize.sh │ ├── prepare.sh │ ├── pkuczynski-pubkey.asc │ ├── rvm-install.sh │ └── mpapis-pubkey.asc ├── config │ ├── memcached.conf │ ├── dpkg-only-english-locale.conf │ ├── 30_presetup_nginx.sh │ ├── 40_presetup_env.sh │ ├── nginx_main_d_default.conf │ ├── dpkg-nodocs.conf │ └── nginx.conf ├── update_baseimage.sh ├── install_base.sh ├── Dockerfile ├── Dockerfile.base ├── memcached.sh ├── redis.sh ├── insecure_key.pub ├── finalize.sh ├── python.sh ├── utilities.sh ├── jruby-9.4.14.0.sh ├── jruby-10.0.2.0.sh ├── enable_repos.sh ├── prepare.sh ├── nodejs.sh ├── ruby-3.3.10.sh ├── ruby-3.4.8.sh ├── ruby-3.2.9.sh ├── install_image.sh ├── buildconfig ├── insecure_key └── nginx-passenger.sh ├── Gemfile ├── .editorconfig ├── test ├── shared │ ├── nodejs_image_spec.rb │ ├── base_system_spec.rb │ └── ruby_image_spec.rb ├── nodejs_image_spec.rb ├── customizable_image_spec.rb ├── full_image_spec.rb ├── spec_helper.rb └── single_ruby_images_spec.rb ├── Gemfile.lock ├── LICENSE.txt ├── Vagrantfile ├── CONTRIBUTING.md ├── CODE_OF_CONDUCT.md ├── .github └── workflows │ └── main.yml ├── Makefile ├── CHANGELOG.md └── README.md /.rspec: -------------------------------------------------------------------------------- 1 | --format d 2 | --color 3 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | Dockerfile.base 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vagrant 3 | *_image 4 | -------------------------------------------------------------------------------- /image/runit/nginx-term: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | sv q nginx 5 | -------------------------------------------------------------------------------- /image/ruby_support/system-rvm-exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exec /usr/local/rvm/bin/rvm-exec "$@" 3 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rake' 4 | gem 'rspec-core' 5 | gem 'rspec-expectations' 6 | -------------------------------------------------------------------------------- /image/config/memcached.conf: -------------------------------------------------------------------------------- 1 | # These arguments are passed to the memcached daemon. 2 | MEMCACHED_OPTS="-l 127.0.0.1" 3 | -------------------------------------------------------------------------------- /image/config/dpkg-only-english-locale.conf: -------------------------------------------------------------------------------- 1 | path-exclude /usr/share/locale/* 2 | path-include /usr/share/locale/locale.alias 3 | path-include /usr/share/locale/en* 4 | -------------------------------------------------------------------------------- /image/config/30_presetup_nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [[ "$PASSENGER_APP_ENV" != "" ]]; then 3 | echo "passenger_app_env '$PASSENGER_APP_ENV';" > /etc/nginx/conf.d/00_app_env.conf 4 | fi 5 | -------------------------------------------------------------------------------- /image/runit/memcached: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | . /etc/memcached.conf 4 | echo "*** Running /usr/bin/memcached $MEMCACHED_OPTS" 5 | exec chpst -u memcache /usr/bin/memcached $MEMCACHED_OPTS >>/var/log/memcached.log 2>&1 6 | -------------------------------------------------------------------------------- /image/update_baseimage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | header "Installing baseimage updates" 6 | 7 | run apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade 8 | -------------------------------------------------------------------------------- /image/runit/nginx: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | # We ensure nginx-log-forwarder is running first so it catches the first log-lines 4 | sv restart /etc/service/nginx-log-forwarder 5 | echo "*** Running /usr/sbin/nginx" 6 | exec /usr/sbin/nginx 7 | -------------------------------------------------------------------------------- /image/install_base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | run /pd_build/enable_repos.sh 6 | run /pd_build/update_baseimage.sh 7 | run /pd_build/prepare.sh 8 | run /pd_build/utilities.sh 9 | run /pd_build/ruby_support/prepare.sh 10 | 11 | cleanup_apt 12 | -------------------------------------------------------------------------------- /image/runit/nginx-log-forwarder: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Forwards the Nginx error.log to the Docker logs. 3 | set -e 4 | if [[ ! -e /var/log/nginx/error.log ]]; then 5 | touch /var/log/nginx/error.log 6 | fi 7 | echo "*** Running tail -F /var/log/nginx/error.log" 8 | exec tail -F /var/log/nginx/error.log 9 | -------------------------------------------------------------------------------- /image/config/40_presetup_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SETUP_ENV="RAILS_ENV RACK_ENV WSGI_ENV NODE_ENV" 4 | SETUP_VALUE=${PASSENGER_APP_ENV:-production} 5 | 6 | for VAR in ${SETUP_ENV}; do 7 | if [ -z ${!VAR:+x} ]; then 8 | echo ${SETUP_VALUE} > /etc/container_environment/${VAR} 9 | fi 10 | done 11 | -------------------------------------------------------------------------------- /image/config/nginx_main_d_default.conf: -------------------------------------------------------------------------------- 1 | # By default, Nginx removes all environment variables inherited from its 2 | # parent process, except for the TZ variable. This is documented at 3 | # http://nginx.org/en/docs/ngx_core_module.html#env 4 | # Because users usually want to inherit PATH, we allow it here 5 | # explicitly. 6 | env PATH; 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://EditorConfig.org 2 | 3 | root = true 4 | 5 | [Gemfile] 6 | indent_style = space 7 | indent_size = 2 8 | trim_trailing_whitespace = true 9 | 10 | [*.rb] 11 | indent_style = space 12 | indent_size = 2 13 | trim_trailing_whitespace = true 14 | 15 | [*.sh] 16 | indent_style = tab 17 | trim_trailing_whitespace = true 18 | -------------------------------------------------------------------------------- /image/runit/redis: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | RUNDIR=/var/run/redis 5 | PIDFILE=$RUNDIR/redis.pid 6 | 7 | mkdir -p $RUNDIR 8 | touch $PIDFILE 9 | chown redis:redis $RUNDIR $PIDFILE 10 | chmod 755 $RUNDIR 11 | 12 | echo "*** Running /usr/bin/redis-server /etc/redis/redis.conf" 13 | exec chpst -u redis /usr/bin/redis-server /etc/redis/redis.conf 14 | -------------------------------------------------------------------------------- /image/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | ARG ARCH 3 | ARG NAME 4 | FROM $NAME-base:latest-$ARCH 5 | MAINTAINER Phusion 6 | 7 | ADD . /pd_build 8 | 9 | ARG ARCH 10 | ARG http_proxy 11 | RUN --mount=type=cache,target=/build_cache \ 12 | /usr/bin/nice /pd_build/install_image.sh 13 | 14 | CMD ["/sbin/my_init"] 15 | EXPOSE 80 443 16 | -------------------------------------------------------------------------------- /test/shared/nodejs_image_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative '../spec_helper' 2 | 3 | shared_examples_for 'a Node.js image' do 4 | it 'includes Node.js' do 5 | expect { capture_command_in_container('node -v') }.not_to raise_error 6 | end 7 | 8 | it 'includes NPM' do 9 | expect { capture_command_in_container('npm -v') }.not_to raise_error 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /image/Dockerfile.base: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.2 2 | FROM phusion/baseimage:noble-1.0.2 3 | MAINTAINER Phusion 4 | 5 | ADD . /pd_build 6 | 7 | ARG ARCH 8 | ARG http_proxy 9 | RUN --mount=type=cache,target=/build_cache \ 10 | rm -rf "/build_cache/${ARCH}" && \ 11 | /usr/bin/nice /pd_build/install_base.sh && \ 12 | rm -rf /pd_build 13 | -------------------------------------------------------------------------------- /image/config/dpkg-nodocs.conf: -------------------------------------------------------------------------------- 1 | path-exclude /usr/share/doc/* 2 | # we need to keep copyright files for legal reasons 3 | path-include /usr/share/doc/*/copyright 4 | path-exclude /usr/share/man/* 5 | path-exclude /usr/share/groff/* 6 | path-exclude /usr/share/info/* 7 | # lintian stuff is small, but really unnecessary 8 | path-exclude /usr/share/lintian/* 9 | path-exclude /usr/share/linda/* 10 | -------------------------------------------------------------------------------- /image/memcached.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | header "Installing memcached..." 6 | 7 | run apt-get update 8 | run apt-get install -y memcached 9 | run mkdir /etc/service/memcached 10 | run cp /pd_build/runit/memcached /etc/service/memcached/run 11 | run touch /etc/service/memcached/down 12 | run cp /pd_build/config/memcached.conf /etc/memcached.conf 13 | -------------------------------------------------------------------------------- /image/redis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | header "Installing Redis..." 6 | 7 | ## Install Redis. 8 | run apt-get update 9 | run apt-get install -y redis-server libhiredis-dev 10 | run mkdir /etc/service/redis 11 | run cp /pd_build/runit/redis /etc/service/redis/run 12 | run cp /pd_build/config/redis.conf /etc/redis/redis.conf 13 | run touch /etc/service/redis/down 14 | -------------------------------------------------------------------------------- /image/insecure_key.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVmzBG5v7cO9IScGLIzlhGlHNFhXzy87VfaPzru7qnIIdQ1e9FEKvtqEws8hVixnCUdviwX5lvcMk4Ef4Tbrmj3dyF0zFtYbjiTSyl/XQlF68DQlc2sTAdHy96wJHvh7ky511tKJzzyWwSqeef4WjeVK28TqcGnq1up0S7saFO0dJh6OfDAg2cDmhyweR3VgT0vZJyrDV7hte95MBCdK+Gp7fdCyEZcWm3S1DBFaeBqHzzt/Y/njAVKbYL9TIVPum8iMg0rMiLi9ShfP+dT5Xud5Oa3dcN2OWhiDfJw5pfhFJWd44cJ/uGRwQpvNs/PNKsYABhgLlTMUH4iawhu1Xb baseimage-docker-insecure-key 2 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | diff-lcs (1.4.4) 5 | rake (13.0.6) 6 | rspec-core (3.10.1) 7 | rspec-support (~> 3.10.0) 8 | rspec-expectations (3.10.1) 9 | diff-lcs (>= 1.2.0, < 2.0) 10 | rspec-support (~> 3.10.0) 11 | rspec-support (3.10.2) 12 | 13 | PLATFORMS 14 | ruby 15 | 16 | DEPENDENCIES 17 | rake 18 | rspec-core 19 | rspec-expectations 20 | 21 | BUNDLED WITH 22 | 1.17.3 23 | -------------------------------------------------------------------------------- /test/nodejs_image_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative 'spec_helper' 2 | require_relative 'shared/base_system_spec' 3 | require_relative 'shared/nodejs_image_spec' 4 | 5 | RSpec.describe 'passenger-nodejs image' do 6 | before(:all) do 7 | @container_id = capture_command( 8 | "docker run -d phusion/passenger-nodejs:#{VERSION} sleep 99999").strip 9 | end 10 | 11 | after(:all) do 12 | run("docker rm -f #{@container_id} >/dev/null") 13 | end 14 | 15 | let(:jruby_dev_arg) { nil } 16 | 17 | include_examples 'a base system' 18 | include_examples 'a Node.js image' 19 | end 20 | -------------------------------------------------------------------------------- /image/finalize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | header "Finalizing..." 6 | 7 | if [[ -e /usr/local/rvm ]]; then 8 | run /usr/local/rvm/bin/rvm cleanup all 9 | fi 10 | 11 | run apt-get remove -y autoconf automake rustc 12 | run apt-get autoremove -y 13 | 14 | if [[ "$final" = 1 ]]; then 15 | run rm -rf /pd_build 16 | else 17 | run rm -f /pd_build/{install,enable_repos,prepare,nginx-passenger,finalize,install_base,install_image,update_baseimage,utilities}.sh 18 | run rm -f /pd_build/{Dockerfile,Dockerfile.base,insecure_key*} 19 | fi 20 | rm -rf /bd_build 21 | -------------------------------------------------------------------------------- /image/ruby_support/dpkg-control: -------------------------------------------------------------------------------- 1 | Source: ruby-fake 2 | Section: ruby 3 | Priority: optional 4 | Maintainer: Unmaintained 5 | Build-Depends: debhelper (>= 9~) 6 | Standards-Version: 3.9.6 7 | Homepage: https://github.com/phusion/passenger-docker 8 | Package: ruby-fake 9 | Version: 1.0.0 10 | Architecture: all 11 | Replaces: jruby1.0, jruby1.1, jruby1.2 12 | Provides: ruby-interpreter, rubygems, rubygems-integration, librack-ruby, ruby-rack 13 | Description: Ruby interpreter (fake package) 14 | This is a fake package that does not contain any files; it exists just to 15 | satisfy dependencies. 16 | -------------------------------------------------------------------------------- /image/python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | VERSION=${1:-3.12} 6 | 7 | header "Installing Python ${VERSION}...." 8 | 9 | ## Install Python. 10 | rm -f /usr/bin/python 11 | if [[ ${VERSION} == "3.12" ]]; then 12 | # baseimage already has 3.12, so just install dev support 13 | minimal_apt_get_install python3-venv python3-dev 14 | else 15 | # otherwise install the deadsnakes PPA and install from there 16 | apt_add_ppa ppa:deadsnakes/ppa 17 | minimal_apt_get_install "python${VERSION}" "python${VERSION}-dev" "python${VERSION}-venv" 18 | fi 19 | ln -s "/usr/bin/python${VERSION}" /usr/bin/python 20 | -------------------------------------------------------------------------------- /image/utilities.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | ## Many Ruby gems and NPM packages contain native extensions and require a compiler. 6 | run minimal_apt_get_install build-essential 7 | ## Bundler has to be able to pull dependencies from git. 8 | run minimal_apt_get_install git 9 | ## JRuby94 at least requires netbase, and other client stuff must. 10 | run minimal_apt_get_install netbase 11 | ## utilities needed to add apt ppas 12 | run minimal_apt_get_install curl gnupg ca-certificates 13 | ## almost everyone needs file, and it sort of randomly gets pulled in during 14 | ## the build process anyway 15 | run minimal_apt_get_install file 16 | -------------------------------------------------------------------------------- /image/jruby-9.4.14.0.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | RVM_ID=$(basename "$0" | sed 's/.sh$//') 6 | 7 | run minimal_apt_get_install openjdk-17-jre-headless 8 | run dpkg-reconfigure ca-certificates-java 9 | 10 | header "Installing $RVM_ID" 11 | run /usr/local/rvm/bin/rvm install $RVM_ID 12 | run /usr/local/rvm/bin/rvm-exec $RVM_ID@global gem install $DEFAULT_RUBY_GEMS --no-document 13 | run create_rvm_wrapper_script jruby9.4 $RVM_ID ruby 14 | run create_rvm_wrapper_script jruby $RVM_ID ruby 15 | # Make passenger_system_ruby work. 16 | run create_rvm_wrapper_script ruby3.1 $RVM_ID ruby 17 | run /pd_build/ruby_support/install_ruby_utils.sh 18 | run /pd_build/ruby_support/finalize.sh 19 | -------------------------------------------------------------------------------- /image/jruby-10.0.2.0.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | RVM_ID=$(basename "$0" | sed 's/.sh$//') 6 | 7 | run minimal_apt_get_install openjdk-21-jre-headless 8 | run dpkg-reconfigure ca-certificates-java 9 | 10 | header "Installing $RVM_ID" 11 | run /usr/local/rvm/bin/rvm install $RVM_ID 12 | run /usr/local/rvm/bin/rvm-exec $RVM_ID@global gem install $DEFAULT_RUBY_GEMS --no-document 13 | run create_rvm_wrapper_script jruby10.0 $RVM_ID ruby 14 | run create_rvm_wrapper_script jruby $RVM_ID ruby 15 | # Make passenger_system_ruby work. 16 | run create_rvm_wrapper_script ruby3.4 $RVM_ID ruby 17 | run /pd_build/ruby_support/install_ruby_utils.sh 18 | run /pd_build/ruby_support/finalize.sh 19 | -------------------------------------------------------------------------------- /image/enable_repos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | header "Preparing APT repositories" 6 | 7 | ## Phusion Passenger 8 | run apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7 9 | if [[ "$PASSENGER_ENTERPRISE" ]]; then 10 | echo "+ Enabling Passenger Enterprise APT repo" 11 | echo deb https://download:$PASSENGER_ENTERPRISE_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt $(lsb_release -cs) main > /etc/apt/sources.list.d/passenger.list 12 | else 13 | echo "+ Enabling Passenger APT repo" 14 | echo deb https://oss-binaries.phusionpassenger.com/apt/passenger $(lsb_release -cs) main > /etc/apt/sources.list.d/passenger.list 15 | fi 16 | 17 | run apt-get update 18 | -------------------------------------------------------------------------------- /image/prepare.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | header "Performing miscellaneous preparation" 6 | 7 | ## Ensure that docs and non-English locales are not installed. 8 | run cp /pd_build/config/dpkg-nodocs.conf /etc/dpkg/dpkg.cfg.d/01_nodoc 9 | run cp /pd_build/config/dpkg-only-english-locale.conf /etc/dpkg/dpkg.cfg.d/01_only_english_locale 10 | 11 | ## Create a user for the web app. 12 | run addgroup --gid 9999 app 13 | run adduser --uid 9999 --gid 9999 --disabled-password --gecos "Application" app 14 | run usermod -L app 15 | run mkdir -p /home/app/.ssh 16 | run chmod 700 /home/app/.ssh 17 | run chown app:app /home/app/.ssh 18 | 19 | ## Fix home dir permissions so nginx can enter it by default 20 | run chmod 755 /home/app 21 | 22 | ## Create a /usr/bin/python for safety 23 | ln -s /usr/bin/python3.12 /usr/bin/python 24 | -------------------------------------------------------------------------------- /test/shared/base_system_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative '../spec_helper' 2 | 3 | shared_examples_for 'a base system' do 4 | it 'includes Passenger' do 5 | expect(capture_command_in_container('passenger -v')).to match(/Phusion Passenger/) 6 | end 7 | 8 | it 'includes Nginx' do 9 | expect(capture_command_in_container('nginx -v')).to match(/nginx version/) 10 | end 11 | 12 | specify 'passenger_system_ruby works' do 13 | expect(capture_command_in_container("passenger_system_ruby #{jruby_dev_arg} -v")).to match(/ruby/) 14 | end 15 | 16 | specify 'passenger_free_ruby works' do 17 | expect(capture_command_in_container("passenger_free_ruby #{jruby_dev_arg} -v")).to match(/ruby/) 18 | end 19 | 20 | specify 'passenger-config validate-install succeeds' do 21 | expect(test_command_in_container('passenger-config validate-install --auto')).to be_truthy 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /image/ruby_support/install_ruby_utils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | ## The Rails asset compiler requires a Javascript runtime. 6 | if [[ ! -e /usr/bin/node ]]; then 7 | /pd_build/nodejs.sh 8 | fi 9 | 10 | ## Ruby pretty much requires tzinfo 11 | if [[ ! -e /usr/sbin/tzconfig ]]; then 12 | run minimal_apt_get_install tzdata 13 | fi 14 | 15 | ## Install development headers for native libraries that tend to be used often by Ruby gems. 16 | if ! [[ -e /tmp/ruby_native_libs_installed ]]; then 17 | ## For nokogiri. 18 | run minimal_apt_get_install libxml2-dev libxslt1-dev 19 | ## For mysql and mysql2. 20 | run minimal_apt_get_install libmysqlclient-dev 21 | ## For sqlite3. 22 | run minimal_apt_get_install libsqlite3-dev 23 | ## For postgres and pg. 24 | run minimal_apt_get_install libpq-dev 25 | ## For all kinds of stuff. 26 | run minimal_apt_get_install zlib1g-dev 27 | 28 | touch /tmp/ruby_native_libs_installed 29 | fi 30 | -------------------------------------------------------------------------------- /test/shared/ruby_image_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative '../spec_helper' 2 | 3 | shared_examples_for 'a Ruby image' do 4 | it 'includes the generic Ruby command' do 5 | expect(capture_command_in_container("ruby #{jruby_dev_arg} -v")).to match(/ruby/) 6 | end 7 | 8 | it 'includes Node.js' do 9 | expect { capture_command_in_container('node -v') }.not_to raise_error 10 | end 11 | 12 | it 'includes RubyGems' do 13 | expect { capture_command_in_container('gem -v') }.not_to raise_error 14 | end 15 | 16 | it 'includes Bundler' do 17 | expect(capture_command_in_container('bundle -v')).to match(/Bundler/) 18 | end 19 | 20 | it 'includes Rake' do 21 | expect(capture_command_in_container('rake -V')).to match(/rake/) 22 | end 23 | end 24 | 25 | shared_examples_for 'a Ruby image containing JRuby' do 26 | it 'includes the generic JRuby command' do 27 | expect(capture_command_in_container('jruby --dev -v')).to match(/jruby/) 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /image/nodejs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | set -x 5 | 6 | VERSION=${1:-22} 7 | if ( ! egrep -q nodesource.gpg /etc/apt/sources.list.d/nodesource.list ); then 8 | ## Install Node.js (also needed for Rails asset compilation) 9 | 10 | header "Installing NodeJS ${VERSION}" 11 | 12 | mkdir -p /etc/apt/keyrings 13 | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --batch --dearmor -o /etc/apt/keyrings/nodesource.gpg 14 | echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list 15 | apt-get update 16 | 17 | minimal_apt_get_install nodejs 18 | 19 | echo "+ Updating npm" 20 | run npm update npm -g || ( cat /root/.npm/_logs/*-debug.log && false ) 21 | if [[ ! -e /usr/bin/node ]]; then 22 | ln -s /usr/bin/nodejs /usr/bin/node 23 | fi 24 | 25 | ## create corepack command symlinks (yarn, etc) 26 | corepack enable 27 | fi 28 | -------------------------------------------------------------------------------- /image/ruby-3.3.10.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | RVM_ID=$(basename "$0" | sed 's/.sh$//') 6 | 7 | header "Installing $RVM_ID" 8 | 9 | run mkdir -p "/build_cache/${ARCH}" 10 | if [[ -e "/build_cache/${ARCH}/${RVM_ID}.tar.bz2" ]]; then 11 | # use cached ruby if present 12 | run /usr/local/rvm/bin/rvm mount "/build_cache/${ARCH}/${RVM_ID}.tar.bz2" 13 | else 14 | # otherwise build one 15 | run minimal_apt_get_install rustc # For compiling Ruby with YJIT 16 | MAKEFLAGS=-j$(nproc) run /usr/local/rvm/bin/rvm install $RVM_ID --disable-cache || ( cat /usr/local/rvm/log/*${RVM_ID}*/*.log && false ) 17 | run cd "/build_cache/${ARCH}" 18 | run /usr/local/rvm/bin/rvm prepare "${RVM_ID}" 19 | run cd / 20 | fi 21 | 22 | run /usr/local/rvm/bin/rvm-exec $RVM_ID@global gem install $DEFAULT_RUBY_GEMS --no-document 23 | # Make passenger_system_ruby work. 24 | run create_rvm_wrapper_script ruby3.3 $RVM_ID ruby 25 | run /pd_build/ruby_support/install_ruby_utils.sh 26 | run /pd_build/ruby_support/finalize.sh 27 | -------------------------------------------------------------------------------- /image/ruby-3.4.8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | RVM_ID=$(basename "$0" | sed 's/.sh$//') 6 | 7 | header "Installing $RVM_ID" 8 | 9 | run mkdir -p "/build_cache/${ARCH}" 10 | if [[ -e "/build_cache/${ARCH}/${RVM_ID}.tar.bz2" ]]; then 11 | # use cached ruby if present 12 | run /usr/local/rvm/bin/rvm mount "/build_cache/${ARCH}/${RVM_ID}.tar.bz2" 13 | else 14 | # otherwise build one 15 | run minimal_apt_get_install rustc # For compiling Ruby with YJIT 16 | MAKEFLAGS=-j$(nproc) run /usr/local/rvm/bin/rvm install $RVM_ID --disable-cache || ( cat /usr/local/rvm/log/*${RVM_ID}*/*.log && false ) 17 | run cd "/build_cache/${ARCH}" 18 | run /usr/local/rvm/bin/rvm prepare "${RVM_ID}" 19 | run cd / 20 | fi 21 | 22 | run /usr/local/rvm/bin/rvm-exec $RVM_ID@global gem install $DEFAULT_RUBY_GEMS --no-document 23 | # Make passenger_system_ruby work. 24 | run create_rvm_wrapper_script ruby3.4 $RVM_ID ruby 25 | run /pd_build/ruby_support/install_ruby_utils.sh 26 | run /pd_build/ruby_support/finalize.sh 27 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 Phusion Holding B.V. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /image/ruby-3.2.9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | RVM_ID=$(basename "$0" | sed 's/.sh$//') 6 | 7 | ## For readline (rvm doesn't always get current package names) 8 | run minimal_apt_get_install libncurses6 libncursesw6 ncurses-base libncurses-dev 9 | 10 | header "Installing $RVM_ID" 11 | 12 | run mkdir -p "/build_cache/${ARCH}" 13 | if [[ -e "/build_cache/${ARCH}/${RVM_ID}.tar.bz2" ]]; then 14 | # use cached ruby if present 15 | run /usr/local/rvm/bin/rvm mount "/build_cache/${ARCH}/${RVM_ID}.tar.bz2" 16 | else 17 | # otherwise build one 18 | run minimal_apt_get_install rustc # For compiling Ruby with YJIT 19 | MAKEFLAGS=-j$(nproc) run /usr/local/rvm/bin/rvm install $RVM_ID --disable-cache || ( cat /usr/local/rvm/log/*${RVM_ID}*/*.log && false ) 20 | run cd "/build_cache/${ARCH}" 21 | run /usr/local/rvm/bin/rvm prepare "${RVM_ID}" 22 | run cd / 23 | fi 24 | 25 | run /usr/local/rvm/bin/rvm-exec $RVM_ID@global gem install $DEFAULT_RUBY_GEMS --no-document 26 | # Make passenger_system_ruby work. 27 | run create_rvm_wrapper_script ruby3.2 $RVM_ID ruby 28 | run /pd_build/ruby_support/install_ruby_utils.sh 29 | run /pd_build/ruby_support/finalize.sh 30 | -------------------------------------------------------------------------------- /image/install_image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | # base cleans up apt before here now 6 | run apt-get update 7 | 8 | if [[ "$ruby32" = 1 ]]; then run /pd_build/ruby-3.2.*.sh; fi 9 | if [[ "$ruby33" = 1 ]]; then run /pd_build/ruby-3.3.*.sh; fi 10 | if [[ "$ruby34" = 1 ]]; then run /pd_build/ruby-3.4.*.sh; fi 11 | if [[ "$ruby35" = 1 ]]; then run /pd_build/ruby-3.5.*.sh; fi 12 | if [[ "$jruby94" = 1 ]]; then run /pd_build/jruby-9.4.*.sh; fi 13 | if [[ "$jruby100" = 1 ]]; then run /pd_build/jruby-10.0.*.sh; fi 14 | if [[ "$nodejs" = 1 ]]; then run /pd_build/nodejs.sh; fi 15 | if [[ "$redis" = 1 ]]; then run /pd_build/redis.sh; fi 16 | if [[ "$memcached" = 1 ]]; then run /pd_build/memcached.sh; fi 17 | if [[ "$python310" = 1 ]]; then run /pd_build/python.sh 3.10; fi 18 | if [[ "$python311" = 1 ]]; then run /pd_build/python.sh 3.11; fi 19 | if [[ "$python312" = 1 ]]; then run /pd_build/python.sh 3.12; fi 20 | if [[ "$python313" = 1 ]]; then run /pd_build/python.sh 3.13; fi 21 | if [[ "$python314" = 1 ]]; then run /pd_build/python.sh 3.14; fi 22 | 23 | # Must be installed after Ruby, so that we don't end up with two Ruby versions. 24 | run /pd_build/nginx-passenger.sh 25 | 26 | run /pd_build/finalize.sh 27 | 28 | cleanup_apt 29 | -------------------------------------------------------------------------------- /image/ruby_support/finalize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | ## Remove useless files. 6 | rm -f /usr/local/rvm/rubies/*/lib/libruby-static.a 7 | 8 | known_rubies=`/usr/local/rvm/bin/rvm list strings` 9 | 10 | ## Fix https://github.com/rvm/rvm/issues/5449 11 | for ver in $known_rubies; do 12 | sed -e 's/require/load/g' -i'' "/usr/local/rvm/rubies/$ver/.irbrc" 13 | done 14 | 15 | ## Set the latest available Ruby as the default. 16 | function set_rvm_default() 17 | { 18 | local regex="$1" 19 | local match 20 | 21 | match=$(grep "$regex" <<< $known_rubies | head -n 1) 22 | echo "+ Setting $match as default RVM Ruby" 23 | bash -lc "rvm use $match --default" 24 | } 25 | 26 | # descending order is important, with jruby last 27 | if [[ "$known_rubies" =~ ruby-3\.4 ]]; then 28 | set_rvm_default ruby-3\.4 29 | elif [[ "$known_rubies" =~ ruby-3\.3 ]]; then 30 | set_rvm_default ruby-3\.3 31 | elif [[ "$known_rubies" =~ ruby-3\.2 ]]; then 32 | set_rvm_default ruby-3\.2 33 | elif [[ "$known_rubies" =~ jruby ]]; then 34 | set_rvm_default jruby 35 | fi 36 | 37 | create_rvm_wrapper_script ruby default ruby 38 | create_rvm_wrapper_script gem default gem 39 | create_rvm_wrapper_script rake default rake 40 | create_rvm_wrapper_script bundle default bundle 41 | create_rvm_wrapper_script bundler default bundler 42 | -------------------------------------------------------------------------------- /test/customizable_image_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative 'spec_helper' 2 | require_relative 'shared/base_system_spec' 3 | require_relative 'shared/ruby_image_spec' 4 | 5 | RSpec.describe 'passenger-customizable image' do 6 | before(:all) do 7 | @container_id = capture_command( 8 | "docker run -d phusion/passenger-customizable:#{VERSION} sleep 99999").strip 9 | end 10 | 11 | after(:all) do 12 | run("docker rm -f #{@container_id} >/dev/null") 13 | end 14 | 15 | let(:jruby_dev_arg) { nil } 16 | 17 | include_examples 'a base system' 18 | 19 | it "includes #{latest_mri_spec[:rvm_id]} as the default Ruby" do 20 | about_regex = 21 | /^#{Regexp.escape latest_mri_spec[:engine]} 22 | [[:blank:]] 23 | #{Regexp.escape latest_mri_spec[:version]} /x 24 | expect(capture_command_in_container('ruby -v')).to match(about_regex) 25 | end 26 | 27 | specify "#{latest_mri_spec[:rvm_id]} is installed through RVM" do 28 | expect(capture_command_in_container('dpkg-query -S /usr/bin/ruby || true')).to match(/no path found/) 29 | expect(test_command_in_container('grep "exec /usr/local/rvm" /usr/bin/ruby')).to be_truthy 30 | expect(test_command_in_container('dpkg-query -L ruby-fake')).to be_truthy 31 | end 32 | 33 | it 'includes exactly one Ruby' do 34 | rubies = capture_command_in_container('/usr/local/rvm/bin/rvm list strings').split("\n") 35 | expect(rubies.size).to eq(1) 36 | end 37 | 38 | it 'does not include Node.js' do 39 | expect(test_command_in_container('which node')).to be_falsey 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /image/ruby_support/prepare.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | source /pd_build/buildconfig 4 | 5 | if [[ -e /tmp/ruby_prepared ]]; then 6 | exit 7 | fi 8 | 9 | echo "+ Updating /etc/gemrc" 10 | echo "gem: --no-document" > /etc/gemrc 11 | 12 | ## Install RVM. 13 | export HOME=/root 14 | run gpg --import /pd_build/ruby_support/mpapis-pubkey.asc 15 | run gpg --import /pd_build/ruby_support/pkuczynski-pubkey.asc 16 | run bash /pd_build/ruby_support/rvm-install.sh stable 17 | echo "+ Updating /etc/profile.d/rvm_secure_path.sh" 18 | echo export rvmsudo_secure_path=1 > /etc/profile.d/rvm_secure_path.sh 19 | echo export rvm_silence_path_mismatch_check_flag=1 >> /etc/profile.d/rvm_silence_path_warning.sh 20 | run chmod +x /etc/profile.d/rvm_secure_path.sh 21 | run chmod +x /etc/profile.d/rvm_silence_path_warning.sh 22 | run usermod -a -G rvm app 23 | 24 | # Note: we cannot install an 'rvm' script to /usr/bin because 25 | # then RVM will try to remove /usr/bin from PATH. 26 | run install -o root /pd_build/ruby_support/system-rvm-exec.sh /usr/bin/rvm-exec 27 | 28 | # Ensure bash always loads the RVM environment. 29 | echo 'if [[ "$rvm_prefix" = "" ]]; then for file in /etc/profile.d/*rvm*; do source $file; done; fi' >> /etc/bash.bashrc 30 | 31 | ## Install fake DPKG entry so that Passenger doesn't install Ruby from APT. 32 | echo "+ In /tmp:" 33 | cd /tmp 34 | run mkdir -p ruby-fake/DEBIAN 35 | run cp /pd_build/ruby_support/dpkg-control ruby-fake/DEBIAN/control 36 | run dpkg-deb -b ruby-fake . 37 | run dpkg -i ruby-fake_1.0.0_all.deb 38 | 39 | ## Ensure that this script isn't run more than once. 40 | touch /tmp/ruby_prepared 41 | -------------------------------------------------------------------------------- /test/full_image_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative 'spec_helper' 2 | require_relative 'shared/base_system_spec' 3 | require_relative 'shared/ruby_image_spec' 4 | require_relative 'shared/nodejs_image_spec' 5 | 6 | RSpec.describe 'passenger-full image' do 7 | before(:all) do 8 | @container_id = capture_command( 9 | "docker run -d phusion/passenger-full:#{VERSION} sleep 99999").strip 10 | end 11 | 12 | after(:all) do 13 | run("docker rm -f #{@container_id} >/dev/null") 14 | end 15 | 16 | let(:jruby_dev_arg) { nil } 17 | 18 | include_examples 'a base system' 19 | include_examples 'a Ruby image' 20 | include_examples 'a Ruby image containing JRuby' 21 | include_examples 'a Node.js image' 22 | 23 | supported_rubies.each do |ruby_spec| 24 | context "#{ruby_spec[:rvm_id]} support" do 25 | let(:ruby_spec) { ruby_spec } 26 | 27 | it 'includes this Ruby' do 28 | ruby_command = "rvm-exec #{ruby_spec[:rvm_id]} ruby #{jruby_dev_arg} -v" 29 | expect(capture_command_in_container(ruby_command)).to \ 30 | match(/^#{Regexp.escape ruby_spec[:engine]} 31 | [[:blank:]] 32 | #{Regexp.escape ruby_spec[:major_minor_version]}[\. ]/x) 33 | end 34 | 35 | it "includes the #{ruby_spec[:engine]}#{ruby_spec[:major_minor_version]} wrapper script" do 36 | ruby_command = "#{ruby_spec[:engine]}#{ruby_spec[:major_minor_version]} #{jruby_dev_arg} -v" 37 | expect(capture_command_in_container(ruby_command)).to \ 38 | match(/^#{Regexp.escape ruby_spec[:engine]} 39 | [[:blank:]] 40 | #{Regexp.escape ruby_spec[:major_minor_version]}[\. ]/x) 41 | end 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /image/buildconfig: -------------------------------------------------------------------------------- 1 | export LC_ALL=C 2 | export DEBIAN_FRONTEND=noninteractive 3 | 4 | DEFAULT_RUBY_GEMS='rake rack' 5 | 6 | if perl -v >/dev/null 2>/dev/null; then 7 | RESET=`perl -e 'print("\e[0m")'` 8 | BOLD=`perl -e 'print("\e[1m")'` 9 | YELLOW=`perl -e 'print("\e[33m")'` 10 | BLUE_BG=`perl -e 'print("\e[44m")'` 11 | elif python -V >/dev/null 2>/dev/null; then 12 | RESET=`echo 'import sys; sys.stdout.write("\033[0m")' | python` 13 | BOLD=`echo 'import sys; sys.stdout.write("\033[1m")' | python` 14 | YELLOW=`echo 'import sys; sys.stdout.write("\033[33m")' | python` 15 | BLUE_BG=`echo 'import sys; sys.stdout.write("\033[44m")' | python` 16 | else 17 | RESET= 18 | BOLD= 19 | YELLOW= 20 | BLUE_BG= 21 | fi 22 | 23 | function minimal_apt_get_install() 24 | { 25 | if [[ ! -e /var/lib/apt/lists/lock ]]; then 26 | apt-get update 27 | fi 28 | apt-get install -y --no-install-recommends "$@" 29 | } 30 | 31 | function apt_add_ppa() 32 | { 33 | add-apt-repository -y $1 34 | apt-get update 35 | } 36 | 37 | function cleanup_apt() 38 | { 39 | run apt-get -y clean 40 | run rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/dpkg.log /var/log/apt/* 41 | } 42 | 43 | function header() 44 | { 45 | local title="$1" 46 | echo "${BLUE_BG}${YELLOW}${BOLD}${title}${RESET}" 47 | echo "------------------------------------------" 48 | } 49 | 50 | function run() 51 | { 52 | echo "+ $@" 53 | "$@" 54 | } 55 | 56 | function create_rvm_wrapper_script() 57 | { 58 | local name="$1" 59 | local rvm_id="$2" 60 | local command="$3" 61 | 62 | rm -f "/usr/bin/$name" 63 | 64 | echo "+ Creating /usr/bin/$name" 65 | echo '#!/bin/sh' >> "/usr/bin/$name" 66 | echo exec "/usr/local/rvm/wrappers/$rvm_id/$command" '"$@"' >> "/usr/bin/$name" 67 | chmod +x "/usr/bin/$name" 68 | } 69 | -------------------------------------------------------------------------------- /image/insecure_key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEA1ZswRub+3DvSEnBiyM5YRpRzRYV88vO1X2j867u6pyCHUNXv 3 | RRCr7ahMLPIVYsZwlHb4sF+Zb3DJOBH+E265o93chdMxbWG44k0spf10JRevA0JX 4 | NrEwHR8vesCR74e5MuddbSic88lsEqnnn+Fo3lStvE6nBp6tbqdEu7GhTtHSYejn 5 | wwINnA5ocsHkd1YE9L2Scqw1e4bXveTAQnSvhqe33QshGXFpt0tQwRWngah887f2 6 | P54wFSm2C/UyFT7pvIjINKzIi4vUoXz/nU+V7neTmt3XDdjloYg3ycOaX4RSVneO 7 | HCf7hkcEKbzbPzzSrGAAYYC5UzFB+ImsIbtV2wIDAQABAoIBAQCjROxgtX2Gft7y 8 | Ix8Ol9IXmK6HLCI2XZt7ovb3hFWGGzHy0qMBql2P2Tzoed1o038Hq+woe9n+uTnE 9 | dtQ6rD6PByzgyW2VSsWTjCOdeJ5HH9Qw7ItXDZZWHBkhfYHOkXI4e2oI3qshGAtY 10 | NLALn7KVhioJriCyyaSM2KOLx5khcY+EJ1inQfwQJKqPGsdKc72liz07T8ifRj+m 11 | NLKtwrxlK3IXYfIdgLp/1pCKdrC80DhprMsD4xvNgq4pCR9jd4FoqM9t/Up5ppTm 12 | +p6A/bDwdIPh6cFFeyMP+G3+bTlW1Gg7RLoNCc6qh53WWVgEOQqdLHcQ8Ge4RLmb 13 | wLUmnRuRAoGBAPfXYfjpPZi8rPIQpux13Bs7xaS1/Fa9WqrEfrPptFdUVHeFCGY8 14 | qOUVewPviHdbs0nB71Ynk9/e96agFYijQdqTQzVnpYI4i8GiGk5gPMiB2UYeJ/HZ 15 | mIB3jtWyf6Z/GO0hJ1a6mX0XD3zJGNqFaiwqaYgdO1Fwh9gcH3O2lHyjAoGBANyj 16 | TGDBYHpxPu6uKcGreLd0SgO61PEj7aOSNfrBB2PK83A+zjZCFZRIWqjfrkxGG6+a 17 | 2WuHbEHuCGvu2V5juHYxbAD/38iV/lQl/2xyvN1eR/baE3US06qn6idxjnmeNZDy 18 | DelAx1RGuEvLX1TNAzDTxBwYyzH3W2RpKAUAD11pAoGAN38YJhd8Pn5JL68A4cQG 19 | dGau/BHwHjAqZEC5qmmzgzaT72tvlQ0SOLHVqOzzHt7+x45QnHciSqfvxnTkPYNp 20 | FJuTGhtKWV12FfbJczFjivZgg63u/d3eoy2iY0GkCdE98KNS3r3L7tHCGwwgr5Xe 21 | T2Nz3BHHnZXYJVEuzcddeocCgYEAnhDjPAHtw2p0Inxlb9kPb6aBC/ECcwtBSUkL 22 | IOy/BZA1HPnxs89eNFAtmwQ8k2o6lXDDSJTJSuZj5CdGVKfuU8aOUJz/Tm2eudxL 23 | A/+jLJhJyCBthhcJyx3m04E4CAr+5ytyKeP9qXPMvoghcNg66/UabuKYV+CU+feX 24 | 8xUa7NkCgYEAlX8HGvWMmiG+ZRFB//3Loy87bBxGlN0pUtCEScabZxdB2HkI9Vp7 25 | Yr67QIZ3y7T88Mhkwam54JCjiV+3TZbSyRMOjkqf7UhTCZC6hHNqdUnlpv4bJWeW 26 | i5Eun8ltYxBnemNc2QGxA4r+KCspi+pRvWNGzL3PFVBGXiLsmOMul78= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /image/config/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes auto; 3 | pid /run/nginx.pid; 4 | daemon off; 5 | 6 | ## 7 | # Error logs 8 | ## 9 | 10 | error_log /var/log/nginx/error.log; 11 | 12 | include /etc/nginx/main.d/*.conf; 13 | include /etc/nginx/modules-enabled/*.conf; 14 | 15 | events { 16 | worker_connections 768; 17 | # multi_accept on; 18 | } 19 | 20 | http { 21 | 22 | ## 23 | # Basic Settings 24 | ## 25 | 26 | sendfile on; 27 | tcp_nopush on; 28 | tcp_nodelay on; 29 | keepalive_timeout 65; 30 | types_hash_max_size 2048; 31 | # server_tokens off; 32 | 33 | # server_names_hash_bucket_size 64; 34 | # server_name_in_redirect off; 35 | 36 | include /etc/nginx/mime.types; 37 | default_type application/octet-stream; 38 | 39 | ## 40 | # SSL Settings 41 | ## 42 | 43 | ssl_protocols TLSv1.2 TLSv1.3; 44 | ssl_prefer_server_ciphers on; 45 | 46 | ## 47 | # Access logs 48 | ## 49 | 50 | access_log /var/log/nginx/access.log; 51 | 52 | ## 53 | # Gzip Settings 54 | ## 55 | 56 | gzip on; 57 | 58 | # gzip_vary on; 59 | # gzip_proxied any; 60 | # gzip_comp_level 6; 61 | # gzip_buffers 16 8k; 62 | # gzip_http_version 1.1; 63 | # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; 64 | 65 | ## 66 | # Virtual Host Configs 67 | ## 68 | 69 | include /etc/nginx/conf.d/*.conf; 70 | include /etc/nginx/sites-enabled/*; 71 | } 72 | 73 | 74 | #mail { 75 | # # See sample authentication script at: 76 | # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript 77 | # 78 | # # auth_http localhost/auth.php; 79 | # # pop3_capabilities "TOP" "USER"; 80 | # # imap_capabilities "IMAP4rev1" "UIDPLUS"; 81 | # 82 | # server { 83 | # listen localhost:110; 84 | # protocol pop3; 85 | # proxy on; 86 | # } 87 | # 88 | # server { 89 | # listen localhost:143; 90 | # protocol imap; 91 | # proxy on; 92 | # } 93 | #} 94 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | ROOT = File.dirname(File.expand_path(__FILE__)) 4 | 5 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 6 | VAGRANTFILE_API_VERSION = '2' 7 | 8 | # Default env properties which can be overridden 9 | # Example overrides: 10 | # echo "ENV['BASEIMAGE_PATH'] ||= '../../phusion/baseimage-docker' " >> ~/.vagrant.d/Vagrantfile 11 | # echo "ENV['BASE_BOX_URL'] ||= 'd\:/dev/vm/vagrant/boxes/phusion/'" >> ~/.vagrant.d/Vagrantfile 12 | BASE_BOX_URL = ENV['BASE_BOX_URL'] || 'https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/' 13 | VAGRANT_BOX_URL = ENV['VAGRANT_BOX_URL'] || BASE_BOX_URL + 'ubuntu-14.04-amd64-vbox.box' 14 | VMWARE_BOX_URL = ENV['VMWARE_BOX_URL'] || BASE_BOX_URL + 'ubuntu-14.04-amd64-vmwarefusion.box' 15 | PASSENGER_DOCKER_PATH = ENV['PASSENGER_DOCKER_PATH'] || '.' 16 | BASEIMAGE_PATH = ENV['BASEIMAGE_PATH'] || '../baseimage-docker' 17 | DOCKERIZER_PATH = ENV['DOCKERIZER_PATH'] || '../dockerizer' 18 | 19 | $script = <