PortGate

Blueprints · Laravel & PHP

Beginner 10 min · Linux

Composer install without dev dependencies

Stages a deploy snippet that uses composer install --no-dev from the lockfile.

Live config

Baked-in protections

Step 1 · bash

Deploy snippet

/root/portgate-blueprints/composer-prod.sh

Run this from the application directory when you are ready to install PHP dependencies.

#!/bin/sh
set -eu
cd "/var/www/app"
composer install --no-dev --prefer-dist --no-interaction

Step 2 · bash

Read-only check

/root/portgate-blueprints/composer-check.sh

Prints status. It does not change the service.

#!/bin/sh
set -eu
if [ -f "/var/www/app/composer.lock" ]; then
  echo "composer.lock is present."
else
  echo "composer.lock is missing."
fi
composer --version || true