Skip to content

Repository files navigation

pnpr

Run Your passenger nginx postgres ruby the simple way

Changelog

  • 3.3
    • 3.3.1 - Change docker-entrypoint.rb to docker-entrypoint.sh to lower memory usage
    • 3.3.2 - Add passenger_max_requests=3000 and passenger_force_max_concurrent_requests_per_process=1000 to /cable
    • 3.3.3 - Remove npm install -g npm

Image naming meaing

v3.3-u20.04-r2.3.1-n10 means:

  • v3.3 - pnpr version
  • u20.04 - ubuntu version
  • r2.3.1 - ruby version
  • n10 - node version

Example docker-compose.yml

version: '3.2'services:
server:
image: ipepe/pnpr:v3.3-u20.04-r2.3.1-n10restart: alwaysnetwork_mode: bridgehealthcheck:
disable: trueenvironment:
PGPASSWORD: Password1RAILS_ENV: 'staging'links:
- postgres_dbports:
- "3322:22"
- "3080:80"volumes:
- ./data/webapp:/home/webapp/webapp
- ./data/ssh:/home/webapp/.sshexpose:
- 80
- 443labels:
- "traefik.enable=true"
- "traefik.port=80"
- "traefik.frontend.rule=Host:example.org"logging:
driver: json-fileoptions:
max-size: 50mpostgres_db:
network_mode: bridgeimage: postgres:15restart: alwaysenvironment:
POSTGRES_DB: webappPOSTGRES_USER: webappPOSTGRES_PASSWORD: Password1expose:
- 5432volumes:
- ./data/db:/var/lib/postgresql/data
- ./data/dbdumps:/dbdumps

Environment variables

VariableDescription
WITHOUT_MALLOC_ARENA_MAXSet to 1 to disable MALLOC_ARENA_MAX=2
RAILS_ENVRails environment, defaults to production
RUBY_VERSIONRuby version, changing it will not reinstall rbenv
NODE_VERSIONNode version, changing it will not reinstall nodenv
RAILS_ENVRails environment, defaults to production
NODE_ENVNode environment, defaults to production
PASSENGER_FRIENDLY_ERROR_PAGESSet to on to enable friendly error pages. Set to off to disable
PASSENGER_MAX_REQUEST_QUEUE_SIZEDefault is 1000, change it based on your preferences
PASSENGER_MAX_POOL_SIZEDefault is 60, change it based on your preferences
PASSENGER_FRIENDLY_ERROR_PAGESSet to on to enable friendly error pages. Set to off to disable
NO_ACTION_CABLESet to 1 to disable action cable
CABLE_PASSENGER_FORCE_MAX_CONCURRENT_REQUESTS_PER_PROCESSDefault is 0, change it based on your preferences
PASSENGER_MAX_REQUESTSDefault is 3000, change it based on your preferences

Cron/whenever is not working

It's probably because bundler command is not found. To ensure that env path is included in cron add env :PATH, ENV['PATH'] to schedule.rb

About

All in one container with ruby+rbenv, nginx + passenger, postgres 10 and redis

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages