Skip to content

Commit 41efb7f

Browse files
docs: update to Docker Compose v2 (#1572)
1 parent c210831 commit 41efb7f

File tree

17 files changed

+44
-44
lines changed

17 files changed

+44
-44
lines changed

admin/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ nelmio_cors:
6565
Clear the cache to apply this change:
6666
6767
```console
68-
docker-compose exec php \
68+
docker compose exec php \
6969
bin/console cache:clear --env=prod
7070
```
7171

client-generator/react.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ yarn start
5252
If you use the API Platform distribution, generating all the code you need for a given resource is as simple as running the following command:
5353

5454
```console
55-
docker-compose exec client \
55+
docker compose exec client \
5656
generate-api-platform-client --resource book -g react
5757
```
5858

client-generator/vuetify.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Remove the directories `client\src\` and `client\public\` and the files `client\
1515
Create a new Vue App and install vuetify and other vue packages:
1616

1717
```console
18-
docker-compose exec client \
18+
docker compose exec client \
1919
vue create -d .
20-
docker-compose exec client \
20+
docker compose exec client \
2121
vue add vuetify
22-
docker-compose exec client \
22+
docker compose exec client \
2323
yarn add router lodash moment vue-i18n vue-router vuelidate vuex vuex-map-fields
2424
```
2525

@@ -45,7 +45,7 @@ Rebuild the docker containers again to install the Vue App and start the vue ser
4545
Generate the vuetify components with the client generator:
4646

4747
```console
48-
docker-compose exec client \
48+
docker compose exec client \
4949
generate-api-platform-client -g vuetify --resource book
5050
```
5151

core/file-upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ before proceeding. It will help you get a grasp on how the bundle works, and why
1313
Install the bundle with the help of Composer:
1414

1515
```console
16-
docker-compose exec php \
16+
docker compose exec php \
1717
composer require vich/uploader-bundle
1818
```
1919

core/graphql.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Once enabled, you have nothing to do: your schema describing your API is automat
1313
To enable GraphQL and its IDE (GraphiQL and GraphQL Playground) in your API, simply require the [graphql-php](https://webonyx.github.io/graphql-php/) package using Composer and clear the cache one more time:
1414

1515
```console
16-
docker-compose exec php sh -c '
16+
docker compose exec php sh -c '
1717
composer require webonyx/graphql-php
1818
bin/console cache:clear
1919
'
@@ -1933,14 +1933,14 @@ You may need to export your schema in SDL (Schema Definition Language) to import
19331933
The `api:graphql:export` command is provided to do so:
19341934

19351935
```shell-session
1936-
docker-compose exec php \
1936+
docker compose exec php \
19371937
bin/console api:graphql:export -o path/to/your/volume/schema.graphql
19381938
```
19391939

19401940
Since the command prints the schema to the output if you don't use the `-o` option, you can also use this command:
19411941

19421942
```shell-session
1943-
docker-compose exec php \
1943+
docker compose exec php \
19441944
bin/console api:graphql:export > path/in/host/schema.graphql
19451945
```
19461946

core/json-schema.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ The generated schema can be used with libraries such as [react-json-schema-form]
1010
To export the schema corresponding to an API Resource, run the following command:
1111

1212
```console
13-
docker-compose exec php \
13+
docker compose exec php \
1414
bin/console api:json-schema:generate 'App\Entity\Book'
1515
```
1616

1717
To see all options available, try:
1818

1919
```console
20-
docker-compose exec php \
20+
docker compose exec php \
2121
bin/console help api:json-schema:generate
2222
```
2323

core/jwt.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ API Platform allows to easily add a JWT-based authentication to your API using [
1414
We begin by installing the bundle:
1515

1616
```console
17-
docker-compose exec php \
17+
docker compose exec php \
1818
composer require jwt-auth
1919
```
2020

2121
Then we need to generate the public and private keys used for signing JWT tokens. If you're using the [API Platform distribution](../distribution/index.md), you may run this from the project's root directory:
2222

2323
```console
24-
docker-compose exec php sh -c '
24+
docker compose exec php sh -c '
2525
set -e
2626
apk add openssl
2727
php bin/console lexik:jwt:generate-keypair
@@ -34,7 +34,7 @@ Note that the `setfacl` command relies on the `acl` package. This is installed b
3434

3535
This takes care of keypair creation (including using the correct passphrase to encrypt the private key), and setting the correct permissions on the keys allowing the web server to read them.
3636

37-
Since these keys are created by the `root` user from a container, your host user will not be able to read them during the `docker-compose build caddy` process. Add the `config/jwt/` folder to the `api/.dockerignore` file so that they are skipped from the result image.
37+
Since these keys are created by the `root` user from a container, your host user will not be able to read them during the `docker compose build caddy` process. Add the `config/jwt/` folder to the `api/.dockerignore` file so that they are skipped from the result image.
3838

3939
If you want the keys to be auto generated in `dev` environment, see an example in the [docker-entrypoint script of api-platform/demo](https://github.com/api-platform/demo/blob/master/api/docker/php/docker-entrypoint.sh).
4040

core/messenger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Many transports are supported to dispatch messages to async consumers, including
1212
To enable the support of Messenger, install the library:
1313

1414
```console
15-
docker-compose exec php \
15+
docker compose exec php \
1616
composer require messenger
1717
```
1818

core/mongodb.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ If you are using the [API Platform Distribution](../distribution/index.md), modi
3737
Then rebuild the `php` image:
3838

3939
```console
40-
docker-compose build php
40+
docker compose build php
4141
```
4242

4343
Add a MongoDB image to the docker-compose file:
@@ -66,7 +66,7 @@ Once the extension is installed, to enable the MongoDB support, require the [Doc
6666
package using Composer:
6767

6868
```console
69-
docker-compose exec php \
69+
docker compose exec php \
7070
composer require doctrine/mongodb-odm-bundle
7171
```
7272

core/openapi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ You can also dump an OpenAPI specification for your API.
2020
OpenAPI, JSON format:
2121

2222
```console
23-
docker-compose exec php \
23+
docker compose exec php \
2424
bin/console api:openapi:export
2525
```
2626

2727
OpenAPI, YAML format:
2828

2929
```console
30-
docker-compose exec php \
30+
docker compose exec php \
3131
bin/console api:openapi:export --yaml
3232
```
3333

3434
Create a file containing the specification:
3535

3636
```console
37-
docker-compose exec php \
37+
docker compose exec php \
3838
bin/console api:openapi:export --output=swagger_docs.json
3939
```
4040

4141
If you want to use the old OpenAPI v2 (Swagger) JSON format, use:
4242

4343
```console
44-
docker-compose exec php \
44+
docker compose exec php \
4545
bin/console api:swagger:export
4646
```
4747

0 commit comments

Comments
 (0)