# What you get, shown as what you type.

Database, queue, cache, storage, domains, TLS, secrets, the scheduler and realtime: what Brewless creates in your own Scaleway and bunny.net accounts, and the line in brewless.yml for each.

A Laravel app needs more than somewhere to run: a database, a queue, somewhere to put uploads, a domain with a certificate on it, and a place for secrets. Each of those is a line in brewless.yml, and a deploy makes it in your own accounts.

## One file, in your repository.

brewless.yml says how each environment should be. It is read on every deploy, which plans what has to change and shows you that plan before anything happens.

```yaml
name: acme
region: fr-par

environments:
  production:
    domain: app.acme.eu
    database: serverless
    cache: redis
    queue: sqs
    storage: uploads
    mail: lettermint
    web:
      min: 1
      max: 20
```

## What a deploy sets up.

Everything here is created inside your own Scaleway project or your own bunny.net account, and billed to you by the provider.

|  | What you get | In brewless.yml |
| --- | --- | --- |
| Web | Serverless containers running FrankenPHP, scaled between the bounds you set. | web: |
| Database | Serverless SQL that sleeps when nobody asks, or Managed PostgreSQL that stays on, with a standby copy when you ask for one. | database: |
| Queue | Scaleway Queues, which call a worker container the moment a job is put on, with your tries and backoff intact. | queue: |
| Cache | A Managed Database for Redis on your project’s Private Network, over TLS. | cache: |
| Storage | An Object Storage bucket for uploads, served over bunny.net on a subdomain of your own. | storage: |
| Mail | A Lettermint project or Scaleway Transactional Email, with the sending domain and its DNS records. | mail: |
| Domains | The record to make at your DNS, a certificate once it answers, and a pull zone in front. | domain: |
| Secrets | Your own Scaleway Secret Manager, with a revision per change. | brewless env:push |
| Schedule | Your Laravel schedule, read from the app on deploy; a worker is called at the moments a task is due. | Nothing. It is read. |
| Realtime | Laravel Reverb on a container of its own, with browsers connecting straight to it. | realtime: |

## What a deploy does, in order.

Every release runs the same way, whether you start it from your laptop or from a pipeline with a token.

- Your code is uploaded and built as a job inside your own Scaleway project. The build never runs on our machines and your source never passes through us.
- Brewless plans what has to change against what is actually there, and shows you that plan. Nothing destructive happens without you agreeing to it.
- Release commands run before the release goes live. Migrations are one of these by default, and a migration that fails keeps the old release serving.
- The new release is put live, the edge cache is emptied, and the old one stays available to roll back to.
- Everything that changed is written to the audit trail: who asked, what moved and when.

## The command line.

Install it once with composer global require brewless/cli. Everything the console does, it does too, which is what makes it usable from a pipeline.

- **brewless init** — Looks at your project, works out what it needs and writes a brewless.yml. If there is a vapor.yml, it reads that and matches it.
- **brewless deploy** — Builds and releases an environment. With a pipeline token in BREWLESS_API_TOKEN it runs from GitHub Actions or GitLab CI after your tests pass.
- **brewless plan** — Shows what a deploy would change, without changing anything.
- **brewless env:pull and env:push** — Your variables and secrets, between your machine and your own Secret Manager. A change reaches the containers with the next deploy.
- **brewless logs** — What your app wrote, from the provider, without opening a console.
- **brewless rollback** — Puts an earlier release back. It brings back your code and your variables; it does not undo a migration.

## Questions about what you get

### Do I need to write a Dockerfile?

No. Brewless builds your image for you from brewless.yml, with the PHP version you name and the extensions a Laravel app needs. The server files are there if you want them, so you can change the Caddy configuration or php.ini, but nothing asks you to start from scratch.

### What happens to my migrations?

They run as a release command, before the release goes live. A migration that fails stops the release, and the old one keeps serving, so a broken deploy does not take your app down. Migrations are never run by hand inside a container.

### Can I run an Artisan command on production?

Yes, against the live release, from the console or the command line. Commands that never end, such as queue:work, are refused, because nothing on a serverless container stays running.

### Where do my environment variables live?

Plain values go under variables in brewless.yml, in your repository. Secrets go into your own Scaleway Secret Manager with brewless env:push, which keeps a revision per change. Brewless keeps the name and the revision, never the value, and refuses a name that looks like a secret in brewless.yml.

### How many environments can I have?

As many as you want, on every plan, including the free one. An environment is a line in brewless.yml, so a branch getting its own is a small change rather than a billing decision.

### Can I deploy from CI instead of my laptop?

Yes. Create a pipeline token, put it in BREWLESS_API_TOKEN, and run brewless deploy as a step after your tests. That is how Brewless itself is deployed.

## Read more

- [The quickstart in the documentation](https://docs.brewless.eu/getting-started/quickstart)
- [Laravel migrations as a release step](https://brewless.eu/blog/laravel-migrations-as-a-release-step)
- [Laravel secrets without a .env file in production](https://brewless.eu/blog/laravel-secrets-without-env-file)
- [Deploying Laravel from CI with a pipeline token](https://brewless.eu/blog/deploy-laravel-from-ci)
- [Serverless SQL or Managed PostgreSQL](https://brewless.eu/blog/serverless-sql-or-managed-postgresql)
- [European services your app can use](https://brewless.eu/integrations)
