Skip to content

Commit 8d71f8f

Browse files
committed
chore: normalize docker compose commands
1 parent 1b01814 commit 8d71f8f

9 files changed

+24
-24
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ with [FrankenPHP](https://frankenphp.dev) and [Caddy](https://caddyserver.com/)
88
## Getting Started
99

1010
1. If not already done, [install Docker Compose](https://docs.docker.com/compose/install/) (v2.10+)
11-
2. Run `docker compose build --no-cache` to build fresh images
12-
3. Run `docker compose up --pull always -d --wait` to set up and start a fresh Symfony project
11+
2. Run `docker compose build --pull --no-cache` to build fresh images
12+
3. Run `docker compose up --wait` to set up and start a fresh Symfony project
1313
4. Open `https://localhost` in your favorite web browser and [accept the auto-generated TLS certificate](https://stackoverflow.com/a/15076602/1352334)
1414
5. Run `docker compose down --remove-orphans` to stop the Docker containers.
1515

docs/existing-project.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Double-check the changes, revert the changes that you don't want to keep:
2929

3030
Build the Docker images:
3131

32-
docker compose build --no-cache --pull
32+
docker compose build --pull --no-cache
3333

3434
Start the project!
3535

36-
docker compose up -d
36+
docker compose up --wait
3737

3838
Browse `https://localhost`, your Docker configuration is ready!
3939

docs/mysql.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ docker compose down --remove-orphans && docker compose build --pull --no-cache
7474

7575
Start the services:
7676
```shell
77-
docker compose up -d
77+
docker compose up --wait
7878
```
7979

8080
Test your setup:

docs/options.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ For instance, use the following command to install Symfony 6.4:
1313

1414
On Linux:
1515

16-
SYMFONY_VERSION=6.4.* docker compose up -d --wait
16+
SYMFONY_VERSION=6.4.* docker compose up --wait
1717
On Windows:
1818

19-
set SYMFONY_VERSION=6.4.* && docker compose up -d --wait&set SYMFONY_VERSION=
19+
set SYMFONY_VERSION=6.4.* && docker compose up --wait&set SYMFONY_VERSION=
2020

2121
## Installing Development Versions of Symfony
2222

@@ -27,17 +27,17 @@ For instance, use the following command to use the development branch of Symfony
2727

2828
On Linux:
2929

30-
STABILITY=dev docker compose up -d --wait
30+
STABILITY=dev docker compose up --wait
3131

3232
On Windows:
3333

34-
set STABILITY=dev && docker compose up -d --wait&set STABILITY=
34+
set STABILITY=dev && docker compose up --wait&set STABILITY=
3535

3636
## Using custom HTTP ports
3737

3838
Use the environment variables `HTTP_PORT`, `HTTPS_PORT` and/or `HTTP3_PORT` to adjust the ports to your needs, e.g.
3939

40-
HTTP_PORT=8000 HTTPS_PORT=4443 HTTP3_PORT=4443 docker compose up -d --wait
40+
HTTP_PORT=8000 HTTPS_PORT=4443 HTTP3_PORT=4443 docker compose up --wait
4141

4242
to access your application on [https://localhost:4443](https://localhost:4443).
4343

@@ -69,4 +69,4 @@ You can also customize the `Caddyfile` by using the following environment variab
6969

7070
### Example of server name customize:
7171

72-
SERVER_NAME="app.localhost" docker compose up -d --wait
72+
SERVER_NAME="app.localhost" docker compose up --wait

docs/production.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ Go into the directory containing your project (`<project-name>`), and start the
6161

6262
```console
6363
# Build fresh production image
64-
docker compose -f compose.yaml -f compose.prod.yaml build --no-cache
64+
docker compose -f compose.yaml -f compose.prod.yaml build --pull --no-cache
6565

6666
# Start container
6767
SERVER_NAME=your-domain-name.example.com \
6868
APP_SECRET=ChangeMe \
6969
CADDY_MERCURE_JWT_SECRET=ChangeThisMercureHubJWTSecretKey \
70-
docker compose -f compose.yaml -f compose.prod.yaml up -d --wait
70+
docker compose -f compose.yaml -f compose.prod.yaml up --wait
7171
```
7272

7373
Be sure to replace `your-domain-name.example.com` with your actual domain name and to set the values of `APP_SECRET`, `CADDY_MERCURE_JWT_SECRET` to cryptographically secure random values.
@@ -89,7 +89,7 @@ Alternatively, if you don't want to expose an HTTPS server but only an HTTP one,
8989
SERVER_NAME=:80 \
9090
APP_SECRET=ChangeMe \
9191
CADDY_MERCURE_JWT_SECRET=ChangeThisMercureHubJWTSecretKey \
92-
docker compose -f compose.yaml -f compose.prod.yaml up -d --wait
92+
docker compose -f compose.yaml -f compose.prod.yaml up --wait
9393
```
9494

9595
## Deploying on Multiple Nodes

docs/tls.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ To disable HTTPS, configure your environment to use HTTP by setting the followin
4545
```bash
4646
SERVER_NAME=http://localhost \
4747
MERCURE_PUBLIC_URL=http://localhost/.well-known/mercure \
48-
docker compose up --pull always -d --wait
48+
docker compose up --wait
4949
```
5050

5151
Ensure your application is accessible over HTTP by visiting `http://localhost` in your web browser.

docs/troubleshooting.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ See more in the [TLS section](tls.md)
1212

1313
### How to properly build fresh images for production use
1414

15-
Remember that, by default, if you run `docker compose up -d`, only the files `compose.yaml` and `compose.override.yaml` will be used.
15+
Remember that, by default, if you run `docker compose up --wait`, only the files `compose.yaml` and `compose.override.yaml` will be used.
1616
See https://docs.docker.com/compose/intro/compose-application-model and https://docs.docker.com/compose/how-tos/multiple-compose-files/merge.
1717

1818
If you need to build images for production environment, you have to use the following command:
1919

2020
```console
21-
docker compose -f compose.yaml -f compose.prod.yaml build --no-cache
21+
docker compose -f compose.yaml -f compose.prod.yaml build --pull --no-cache
2222
```
2323

2424
### Why application outputs `phpinfo()`
@@ -27,7 +27,7 @@ Both dev and prod images have the same image tag (`<...>app-php:latest`). This c
2727
It is important to make sure that your image is the appropriate one for the current environment.
2828

2929
If you are not careful about this, and try to run your production container(s) with
30-
`docker compose -f compose.yaml -f compose.prod.yaml up -d`
30+
`docker compose -f compose.yaml -f compose.prod.yaml up --wait`
3131
without the right build process beforehand, your application **will still launch**, but will be displaying an output of `phpinfo()` (or possibly even a HTTP 500 error page).
3232

3333
See details below.
@@ -45,7 +45,7 @@ Which is good enough for dev purposes.
4545
Then, you can start your dev container(s) by running:
4646

4747
```console
48-
docker compose up -d
48+
docker compose up --wait
4949
```
5050

5151

@@ -58,15 +58,15 @@ docker compose up -d
5858
<summary>Output expected for the production build process</summary>
5959

6060
To build the production image, you <ins>have to</ins> specify the `compose.yaml` and `compose.prod.yaml` files.
61-
This means you have to run: `docker compose -f compose.yaml -f compose.prod.yaml build` in order to build your image
61+
This means you have to run: `docker compose -f compose.yaml -f compose.prod.yaml build --pull --no-cache` in order to build your image
6262
(careful: the order of `-f` arguments is important).
6363

6464
That way, you will see that `frankenphp_base` and `frankenphp_prod` are built this time, which is what you will need for production purposes.
6565

6666
You can finally start your prod container(s) by running:
6767

6868
```console
69-
docker compose -f compose.yaml -f compose.prod.yaml up -d
69+
docker compose -f compose.yaml -f compose.prod.yaml up --wait
7070
```
7171

7272
</details>

docs/xdebug.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ It can be enabled by setting the `XDEBUG_MODE` environment variable to `debug`.
99
On Linux and Mac:
1010

1111
```
12-
XDEBUG_MODE=debug docker compose up -d
12+
XDEBUG_MODE=debug docker compose up --wait
1313
```
1414

1515
On Windows:
1616

1717
```
18-
set XDEBUG_MODE=debug&& docker compose up -d&set XDEBUG_MODE=
18+
set XDEBUG_MODE=debug&& docker compose up --wait&set XDEBUG_MODE=
1919
```
2020

2121
## Debugging with Xdebug and PHPStorm

frankenphp/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
1717
composer config --json extra.symfony.docker 'true'
1818

1919
if grep -q ^DATABASE_URL= .env; then
20-
echo 'To finish the installation please press Ctrl+C to stop Docker Compose and run: docker compose up --build -d --wait'
20+
echo 'To finish the installation please press Ctrl+C to stop Docker Compose and run: docker compose up --build --wait'
2121
sleep infinity
2222
fi
2323
fi

0 commit comments

Comments
 (0)