Skip to content

Instantly share code, notes, and snippets.

@sagalbot
Last active July 9, 2025 18:02
Show Gist options
  • Save sagalbot/8fcbc1a10c1fc95c78162fc0e786d2d6 to your computer and use it in GitHub Desktop.
Save sagalbot/8fcbc1a10c1fc95c78162fc0e786d2d6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euo pipefail
# Install system dependencies
apt-get update -qq
apt-get install -y -qq --no-install-recommends \
php-cli \
php-mbstring \
php-xml \
php-curl \
php-bcmath \
php-mysql \
php-tokenizer \
php-zip \
php-sqlite3 \
php-common
# php-gd \
# php-pgsql \
# php-intl
# Install Composer
EXPECTED_CHECKSUM="$(curl -fsSL https://composer.github.io/installer.sig)"
curl -fsSL https://getcomposer.org/installer -o composer-setup.php
ACTUAL_CHECKSUM="$(sha384sum composer-setup.php | cut -d ' ' -f 1)"
[ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] && exit 1
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
rm composer-setup.php
# Install Laravel project dependencies
composer install --no-interaction --prefer-dist --optimize-autoloader
# Create SQLite DB
touch database/database.sqlite
cp .env.example .env
sed -i 's/DB_CONNECTION=.*/DB_CONNECTION=sqlite/' .env
sed -i 's/DB_DATABASE=.*/DB_DATABASE=database\/database.sqlite/' .env
php artisan key:generate
# Run migrations
php artisan migrate --force
npm install
npm run build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment