PHPackages                             ipunkt/rancherize - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. ipunkt/rancherize

AbandonedLibrary[DevOps &amp; Deployment](/categories/devops)

ipunkt/rancherize
=================

rancherize your development workflow

2.51.3(6y ago)67.0k14MIT

Since Sep 6Compare

[ Source](https://github.com/ipunkt/rancherize)[ Packagist](https://packagist.org/packages/ipunkt/rancherize)[ RSS](/packages/ipunkt-rancherize/feed)WikiDiscussions Synced today

READMEChangelog (10)Dependencies (8)Versions (188)Used By (14)

Rancherize
==========

[](#rancherize)

[![Latest Stable Version](https://camo.githubusercontent.com/f01f2d07fc637fc5eb066b7df1c4a68c3149db342f66a48487b8e670d5ffb359/68747470733a2f2f706f7365722e707567782e6f72672f6970756e6b742f72616e63686572697a652f762f737461626c652e737667)](https://packagist.org/packages/ipunkt/rancherize) [![Latest Unstable Version](https://camo.githubusercontent.com/6676e92a9931925dc6b4f0d727b9e0e36fdc142d1f1af34c0c801d51ffefca65/68747470733a2f2f706f7365722e707567782e6f72672f6970756e6b742f72616e63686572697a652f762f756e737461626c652e737667)](https://packagist.org/packages/ipunkt/rancherize) [![License](https://camo.githubusercontent.com/0679f1457094d1cb379337a3c24ab022abf9f2235e46ccebff4d1faeea5f3e76/68747470733a2f2f706f7365722e707567782e6f72672f6970756e6b742f72616e63686572697a652f6c6963656e73652e737667)](https://packagist.org/packages/ipunkt/rancherize) [![Total Downloads](https://camo.githubusercontent.com/e3e079fe65ac9acd16dcbbbcb2fa5ba96f0601bddd50c8a1f5d19a26e4558e49/68747470733a2f2f706f7365722e707567782e6f72672f6970756e6b742f72616e63686572697a652f646f776e6c6f6164732e737667)](https://packagist.org/packages/ipunkt/rancherize) [![Docker Pulls](https://camo.githubusercontent.com/6788ca2daae292f0f6c4e65134ddfe8433f56516fe47f3be3320d44b21905f71/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6970756e6b7462732f72616e63686572697a652e737667)](https://hub.docker.com/r/ipunktbs/rancherize/) [![Docker Build Status](https://camo.githubusercontent.com/0face1d3db5a730924cc0ac3158cc1d9769c17901ce09dcd3fa55a996e1491d5/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f6275696c642f6970756e6b7462732f72616e63686572697a652e737667)](https://hub.docker.com/r/ipunktbs/rancherize/)

Rancherize is a php cli script based on symfony/console. It makes developing with docker and rancher easy for developers without specialized knowledge in the subjects. This is done by choosing a blueprint that fits your apps required environment and setting abstract requirements instead of of adding and connecting services.

For a concrete example on how the configuration becomes easier through this see the example at the bottom of this page.

IMPORTANT UPDATE
================

[](#important-update)

As of 2.23.0 the default behaviour for pushed services has changed to always pull images on an upgrade.
This can be disabled by setting `docker.always-pull: false` in either the defaults or the environment.

Usage as docker container (preferred)
=====================================

[](#usage-as-docker-container-preferred)

Rancherize comes bundled as Docker Container [`ipunktbs/rancherize`](https://hub.docker.com/r/ipunktbs/rancherize/).

Requirements
------------

[](#requirements)

Rancherize creates configuration to be used with external docker tools. Thus it is necessary to have the following tools installed to use Rancherize:

- `docker`

Install on linux
----------------

[](#install-on-linux)

No need to separately install it. To use it, just make a shell alias:

```
alias rancherize='docker run -it --init -v $HOME/.rancherize:/home/rancherize/.rancherize -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):$(pwd) -w $(pwd) -e "USER_ID=$(id -u)" -e "GROUP_ID=$(id -g)" ipunktbs/rancherize:2-stable'

```

or use the provided script `script/rancherize.sh`.

From now on use rancherize without other dependencies for your local environment than docker.

Usage in build tools
====================

[](#usage-in-build-tools)

With build tools like jenkins or gitlab-ci, you cannot rely on the presence of a .rancherize file in the home-dir. For this usecase you can set account settings with environment variables on the [docker container](https://hub.docker.com/r/ipunktbs/rancherize/) on runtime. best practise would be to include these variables via secrets.

- `DOCKER_SERVER` - registry server (e.g. registry.gitlab.com), ignore or leave empty for dockerhub
- `DOCKER_USER` - username for dockerhub / registry
- `DOCKER_PASSWORD` - password for dockerhub / registry
- `DOCKER_ECR` - true if using [AWS ECR](https://aws.amazon.com/ecr/)
- `RANCHER_URL` - rancher environment api-url
- `RANCHER_KEY` - rancher api-key
- `RANCHER_SECRET` - rancher api-secret
- `RANCHER_ACCOUNTNAME_URL` - alternative rancher environment api-url when using rancher.account = 'ACCOUNTNAME'
- `RANCHER_ACCOUNTNAME_KEY` - alternative rancher api-key when using rancher.account = 'ACCOUNTNAME'
- `RANCHER_ACCOUNTNAME_SECRET` - alternative rancher api-secret when using rancher.account = 'ACCOUNTNAME'

Note that `RANCHER_ACCOUNTNAME_{URL,KEY,SECRET}` are only parsed when `RANCHER_URL` is set. Setting them without default account will NOT work.

Usage in project
================

[](#usage-in-project)

Requirements
------------

[](#requirements-1)

Rancherize creates configuration to be used with external docker tools. Thus it is necessary to have the following tools installed to use Rancherize:

- `docker`
- `docker-compose`
- `rancher-compose`

Installation
------------

[](#installation)

Rancherize is installed using composer

```
composer require 'ipunkt/rancherize:^2.5.0'

```

Configuration
=============

[](#configuration)

Accounts
--------

[](#accounts)

Rancherize knows 2 types of accounts:

- docker accounts. They are used to push images to docker hub
- rancher accounts. They are used to deploy your app to your rancher environment

Both are managed in the json file `~/.rancherize` which should be set to be only readable by your own user.
For easy editing use the following command. It opens the file in your `$EDITOR` and creates a default file if it does not exist yet.

```
vendor/bin/rancherize rancher:access

```

Environments
------------

[](#environments)

Rancherize configuration is split into `environments`. A typical app knows at least a `local` and a `production`environment. Environments are configured by editing the file `rancherize.json` inside the app work directory.

Note that all configuration values can also be set in the `defaults` section. Values in this section will be used if the configuration value does not appear in the `environment`See [Environments and Defaults](#environments-and-defaults) for a longer explanation on how to best use environments

The command `init` can be used to create an initial configuration for an environment.
It will prompt the blueprint to create a sensible default production configuration. If the `--dev` Flag is used then a configuration for a local development environment is created instead.

```
vendor/bin/rancherize init [--dev] BLUEPRINT ENVIRONENTNAME1 ENVIRONEMNTNAME2... ENVIRONMENTNAMEX

e.g.
vendor/bin/rancherize init --dev webserver local
vendor/bin/rancherize init webserver production staging

```

### Set Environment Variable

[](#set-environment-variable)

The command `environment:set` exists to conveniently set an environment value for all `environments`. It will go through all `environments`, display the current value and ask for the new value. If none is given then the old value will be used again.

```
vendor/bin/rancherize environment:set VARIABLENAME

e.g.
vendor/bin/rancherize environment:set APP_KEY

```

Development Environment
-----------------------

[](#development-environment)

The command `start` exists to start an environment of your app on the local machine.

```
vendor/bin/rancherize start ENVIRONMENTNAME

e.g.
vendor/bin/rancherize start local

```

Note that this command does not currently build a docker image from your work directory so the `environment` should be set to mount your work directory directly. For the WebserverBlueprint this means setting

- `"use-app-container": false`
- `"mount-workdir":"true"`

Theses settings are included when initializing with the `--dev` flag

Deploy
------

[](#deploy)

### Push

[](#push)

The command `push` exists to deploy the current state of your work directory into Rancher.

```
vendor/bin/rancherize push ENVIRONEMNT VERSION

e.g.
vendor/bin/rancherize push staging v1

```

- The current state of your work directory is build as docker image and tagged as `$(docker.repository):$(docker.version-prefix)VERSION`
- The built Image is pushed to docker hub using the credentials from the global configuration named `$(docker.account)`
- The current configuration of the stack in rancher is retrieved
    - If the stack does not exist yet it is created empty
- The apps configuration is added to the stack configuration
- The app is deployed into the stack
    - If no other version of the service is found it will be created
    - !NEW! If `rancher.in-service` is set to `true` then a rolling upgrade will be triggered to a non-versionized name and subsequently in-service upgrades of this service
    - If the same version of the service is found then an in-service upgrade is triggered
    - If a different version of the service is found then a rolling-upgrade ist triggered
    - In case of an in-service upgrade rancherize waits for the stack to reach `upgraded` and confirms the upgrade.
        You can set `rancher.upgrade-healthcheck` to `true` to wait for it to report `healthy` instead. Not that this only works if a service has a health-check is defined(not yet supported through rancherize)

### Build image

[](#build-image)

The command `build-image` exists to build the current state of your work directory into the docker registry, then deploy them via `push -i`. It is essentially the `push` command without any interaction with rancher.

Blueprints
==========

[](#blueprints)

Blueprint neutral configuration
-------------------------------

[](#blueprint-neutral-configuration)

- [Force resource limits](app/Validation/ForceResourceLimits/README.md)

Known Blueprints
----------------

[](#known-blueprints)

- [Php Webserver](app/Blueprint/Webserver/README.md)
- [Php Cli](https://github.com/ipunkt/rancherize-blueprint-php-cli)

Developing Blueprints
---------------------

[](#developing-blueprints)

See the [Blueprint readme](app/Blueprint/README.md) for more information on how to develop your own blueprints

Example
=======

[](#example)

[List of examples](EXAMPLES.md)

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Recently: every ~41 days

Total

179

Last Release

2274d ago

Major Versions

0.1.0 → 2.0.02016-11-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f1ab6ff16fc96d20efd363563c961db68587721536c6559d692f461588a1246?d=identicon)[svensp](/maintainers/svensp)

---

Top Contributors

[![justb81](https://avatars.githubusercontent.com/u/3680539?v=4)](https://github.com/justb81 "justb81 (21 commits)")[![brauni182](https://avatars.githubusercontent.com/u/8652453?v=4)](https://github.com/brauni182 "brauni182 (1 commits)")

---

Tags

dockerrancher

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ipunkt-rancherize/health.svg)

```
[![Health](https://phpackages.com/badges/ipunkt-rancherize/health.svg)](https://phpackages.com/packages/ipunkt-rancherize)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19664.8M1.6k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k16.8k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
