Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public/vendor/livewire/

# Docker setup (published from saucebase/installer package)
/docker/
/docker-compose.yml

# Generated files
lang/php_*.json
Expand Down
50 changes: 50 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,56 @@ npm run dev # Herd serves PHP; Vite serves assets

If several local sites share one Redis, give each its own `REDIS_PREFIX`.

### Docker

The `saucebase` CLI publishes the Docker files (nginx, PHP-FPM, MySQL, Redis,
Mailpit and a queue worker). PHP, Composer and Node still run on the host for
the CLI, Vite and the tests.

```bash
git clone https://github.com/saucebase-dev/saucebase.git
cd saucebase
saucebase docker:publish --ssl=no
cp .env.example .env # then edit, see below
docker compose up -d --wait
docker compose exec app composer install
saucebase stack vue --dev # or: react
docker compose exec app php artisan key:generate
docker compose up -d --wait --force-recreate
docker compose exec app php artisan migrate --seed
docker compose exec app php artisan boost:install
npm run dev # http://localhost
```

In `.env`, switch to MySQL and set the credentials the `mysql` service is
created with:

```dotenv
DB_CONNECTION=mysql
DB_DATABASE=saucebase
DB_USERNAME=saucebase
DB_PASSWORD=secret
```

- Compose passes `.env` values to the containers when they start, and those
override `.env` inside the app. That's why the containers are recreated after
`key:generate`. Do the same after changing `.env`.
- Run `boost:install` interactively and pick your agents. Inside the container
it can't detect them, and `boost:update` fails without any.
- Ports clash with Herd or other local services? Change them in `.env`:
`APP_PORT`, `APP_HTTPS_PORT`, `FORWARD_DB_PORT`, `FORWARD_REDIS_PORT`,
`FORWARD_MAILPIT_PORT`, `FORWARD_MAILPIT_DASHBOARD_PORT`. Update `APP_URL` to
match.
- Server-side rendering doesn't run with `npm run dev`: PHP in the container
can't reach Vite on the host, so pages render in the browser only.
- Prefix artisan and Composer commands, including a module's install steps,
with `docker compose exec app`.

> [!WARNING]
> Run tests on the host, never inside the container. The container's
> `DB_CONNECTION` overrides `phpunit.xml`, so tests would run against your app's
> database and wipe it.

### Signing in

The app has no sign-in of its own. The home page works out of the box, but
Expand Down
Loading