diff --git a/admin/getting-started.md b/admin/getting-started.md index 621df7200d3..4c22c8f7b7a 100644 --- a/admin/getting-started.md +++ b/admin/getting-started.md @@ -65,7 +65,7 @@ nelmio_cors: Clear the cache to apply this change: ```console -docker-compose exec php \ +docker compose exec php \ bin/console cache:clear --env=prod ``` diff --git a/client-generator/react.md b/client-generator/react.md index ac2ace82d23..8ce835d4db0 100644 --- a/client-generator/react.md +++ b/client-generator/react.md @@ -52,7 +52,7 @@ yarn start 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: ```console -docker-compose exec client \ +docker compose exec client \ generate-api-platform-client --resource book -g react ``` diff --git a/client-generator/vuetify.md b/client-generator/vuetify.md index 4acc979cf7b..2cececd151e 100644 --- a/client-generator/vuetify.md +++ b/client-generator/vuetify.md @@ -15,11 +15,11 @@ Remove the directories `client\src\` and `client\public\` and the files `client\ Create a new Vue App and install vuetify and other vue packages: ```console -docker-compose exec client \ +docker compose exec client \ vue create -d . -docker-compose exec client \ +docker compose exec client \ vue add vuetify -docker-compose exec client \ +docker compose exec client \ yarn add router lodash moment vue-i18n vue-router vuelidate vuex vuex-map-fields ``` @@ -45,7 +45,7 @@ Rebuild the docker containers again to install the Vue App and start the vue ser Generate the vuetify components with the client generator: ```console -docker-compose exec client \ +docker compose exec client \ generate-api-platform-client -g vuetify --resource book ``` diff --git a/core/file-upload.md b/core/file-upload.md index 907ea2e2790..eb976dee614 100644 --- a/core/file-upload.md +++ b/core/file-upload.md @@ -13,7 +13,7 @@ before proceeding. It will help you get a grasp on how the bundle works, and why Install the bundle with the help of Composer: ```console -docker-compose exec php \ +docker compose exec php \ composer require vich/uploader-bundle ``` diff --git a/core/graphql.md b/core/graphql.md index 53c31f86139..4466c8380c2 100644 --- a/core/graphql.md +++ b/core/graphql.md @@ -13,7 +13,7 @@ Once enabled, you have nothing to do: your schema describing your API is automat 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: ```console -docker-compose exec php sh -c ' +docker compose exec php sh -c ' composer require webonyx/graphql-php bin/console cache:clear ' @@ -1933,14 +1933,14 @@ You may need to export your schema in SDL (Schema Definition Language) to import The `api:graphql:export` command is provided to do so: ```shell-session -docker-compose exec php \ +docker compose exec php \ bin/console api:graphql:export -o path/to/your/volume/schema.graphql ``` Since the command prints the schema to the output if you don't use the `-o` option, you can also use this command: ```shell-session -docker-compose exec php \ +docker compose exec php \ bin/console api:graphql:export > path/in/host/schema.graphql ``` diff --git a/core/json-schema.md b/core/json-schema.md index 3f09600addb..9c4366ea9ed 100644 --- a/core/json-schema.md +++ b/core/json-schema.md @@ -10,14 +10,14 @@ The generated schema can be used with libraries such as [react-json-schema-form] To export the schema corresponding to an API Resource, run the following command: ```console -docker-compose exec php \ +docker compose exec php \ bin/console api:json-schema:generate 'App\Entity\Book' ``` To see all options available, try: ```console -docker-compose exec php \ +docker compose exec php \ bin/console help api:json-schema:generate ``` diff --git a/core/jwt.md b/core/jwt.md index 8fa95c8e75b..6dad6fdd2fb 100644 --- a/core/jwt.md +++ b/core/jwt.md @@ -14,14 +14,14 @@ API Platform allows to easily add a JWT-based authentication to your API using [ We begin by installing the bundle: ```console -docker-compose exec php \ +docker compose exec php \ composer require jwt-auth ``` 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: ```console -docker-compose exec php sh -c ' +docker compose exec php sh -c ' set -e apk add openssl 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 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. -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. +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. 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). diff --git a/core/messenger.md b/core/messenger.md index 4cfb045745b..45102c93f2f 100644 --- a/core/messenger.md +++ b/core/messenger.md @@ -12,7 +12,7 @@ Many transports are supported to dispatch messages to async consumers, including To enable the support of Messenger, install the library: ```console -docker-compose exec php \ +docker compose exec php \ composer require messenger ``` diff --git a/core/mongodb.md b/core/mongodb.md index 2e1d6478238..750816e99ec 100644 --- a/core/mongodb.md +++ b/core/mongodb.md @@ -37,7 +37,7 @@ If you are using the [API Platform Distribution](../distribution/index.md), modi Then rebuild the `php` image: ```console -docker-compose build php +docker compose build php ``` 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 package using Composer: ```console -docker-compose exec php \ +docker compose exec php \ composer require doctrine/mongodb-odm-bundle ``` diff --git a/core/openapi.md b/core/openapi.md index 201a0b29214..1cfc7909ffe 100644 --- a/core/openapi.md +++ b/core/openapi.md @@ -20,28 +20,28 @@ You can also dump an OpenAPI specification for your API. OpenAPI, JSON format: ```console -docker-compose exec php \ +docker compose exec php \ bin/console api:openapi:export ``` OpenAPI, YAML format: ```console -docker-compose exec php \ +docker compose exec php \ bin/console api:openapi:export --yaml ``` Create a file containing the specification: ```console -docker-compose exec php \ +docker compose exec php \ bin/console api:openapi:export --output=swagger_docs.json ``` If you want to use the old OpenAPI v2 (Swagger) JSON format, use: ```console -docker-compose exec php \ +docker compose exec php \ bin/console api:swagger:export ``` diff --git a/core/performance.md b/core/performance.md index 09607d59be7..0c233544e01 100644 --- a/core/performance.md +++ b/core/performance.md @@ -396,8 +396,8 @@ To configure Blackfire.io follow these simple steps: 4. Rebuild and restart all your containers ```console - docker-compose build - docker-compose up -d + docker compose build + docker compose up -d ``` For details on how to perform profiling, see [the Blackfire.io documentation](https://blackfire.io/docs/integrations/docker#using-the-client-for-http-profiling). diff --git a/core/testing.md b/core/testing.md index 02c2363b121..0ef1e716808 100644 --- a/core/testing.md +++ b/core/testing.md @@ -17,7 +17,7 @@ Reuse them to run, for instance, SQL queries or requests to external APIs direct Install the `symfony/http-client` and `symfony/browser-kit` packages to enabled the API Platform test client: ```console -docker-compose exec php \ +docker compose exec php \ composer require symfony/browser-kit symfony/http-client ``` diff --git a/deployment/docker-compose.md b/deployment/docker-compose.md index c9e96ced7d9..51ca1fb85a7 100644 --- a/deployment/docker-compose.md +++ b/deployment/docker-compose.md @@ -73,7 +73,7 @@ SERVER_NAME=your-domain-name.example.com \ APP_SECRET=ChangeMe \ POSTGRES_PASSWORD=ChangeMe \ CADDY_MERCURE_JWT_SECRET=ChangeMe \ -docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d +docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d ``` 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. diff --git a/distribution/debugging.md b/distribution/debugging.md index 13d9d44b658..c64905f3065 100644 --- a/distribution/debugging.md +++ b/distribution/debugging.md @@ -91,7 +91,7 @@ Inspect the installation with the following command. The requested Xdebug version should be displayed in the output. ```console -$ docker-compose exec php \ +$ docker compose exec php \ php --version PHP … diff --git a/distribution/index.md b/distribution/index.md index aa168093412..6fa11322583 100644 --- a/distribution/index.md +++ b/distribution/index.md @@ -76,16 +76,16 @@ services using [Docker Compose](https://docs.docker.com/compose/): Download and build the latest versions of the images: ```console -docker-compose build --pull --no-cache +docker compose build --pull --no-cache ``` Start Docker Compose in detached mode: ```console -docker-compose up -d +docker compose up -d ``` -**Tip:** be sure that the ports `80`, `443` and `5432` of the host are not already in use. The usual offenders are Apache, NGINX and Postgres. If they are running, stop them and run `docker-compose up -d` again. +**Tip:** be sure that the ports `80`, `443` and `5432` of the host are not already in use. The usual offenders are Apache, NGINX and Postgres. If they are running, stop them and run `docker compose up -d` again. This starts the following services: @@ -107,7 +107,7 @@ The following components are available: To see the container's logs, run: ```console -docker-compose logs -f +docker compose logs -f ``` The `-f` option is to follow the logs. @@ -446,7 +446,7 @@ Modify these files as described in these patches: **Tip**: you can also use Symfony [MakerBundle](https://symfonycasts.com/screencast/symfony-fundamentals/maker-command?cid=apip) thanks to the `--api-resource` option: ```console -docker-compose exec php \ +docker compose exec php \ bin/console make:entity --api-resource ``` @@ -462,13 +462,13 @@ Now, delete the file `api/src/Entity/Greeting.php`. This demo entity isn't usefu Finally, generate a new database migration using [Doctrine Migrations](https://symfony.com/doc/current/doctrine.html#migrations-creating-the-database-tables-schema) and apply it: ```console -docker-compose exec php \ +docker compose exec php \ bin/console doctrine:migrations:diff -docker-compose exec php \ +docker compose exec php \ bin/console doctrine:migrations:migrate ``` -The `php` container is where your API app stands. Prefixing a command by `docker-compose exec php` allows executing the +The `php` container is where your API app stands. Prefixing a command by `docker compose exec php` allows executing the given command in this container. You may want [to create an alias](http://www.linfo.org/alias.html) to make your life easier. **We now have a working API with read and write capabilities!** @@ -660,7 +660,7 @@ Isn't API Platform a REST **and** GraphQL framework? That's true! GraphQL suppor need to install the [graphql-php](https://webonyx.github.io/graphql-php/) library. Run the following command: ```console -docker-compose exec php sh -c ' +docker compose exec php sh -c ' composer require webonyx/graphql-php bin/console cache:clear ' @@ -750,7 +750,7 @@ API Platform also has an awesome [client generator](../client-generator/index.md The distribution comes with a skeleton ready to welcome the [Next.js](https://nextjs.org/) flavor of the generated code. To bootstrap your app, run: ```console -docker-compose exec pwa \ +docker compose exec pwa \ generate-api-platform-client ``` diff --git a/distribution/testing.md b/distribution/testing.md index 89db4e2ebaf..977cfe37b44 100644 --- a/distribution/testing.md +++ b/distribution/testing.md @@ -25,7 +25,7 @@ Before creating your functional tests, you will need a dataset to pre-populate y First, install [Alice](https://github.com/nelmio/alice): ```console -docker-compose exec php \ +docker compose exec php \ composer require --dev alice ``` @@ -59,7 +59,7 @@ App\Entity\Review: You can now load your fixtures in the database with the following command: ```console -docker-compose exec php \ +docker compose exec php \ bin/console hautelook:fixtures:load ``` @@ -75,8 +75,8 @@ Install the Symfony test pack (which includes PHPUnit and [PHPUnit Bridge](https (the API Platform test client is built on top of Symfony HttpClient, and allows to leverage all its features) and [JSON Schema for PHP](https://github.com/justinrainbow/json-schema) (used by API Platform to provide [JSON Schema](https://json-schema.org/) test assertions): ```console - docker-compose exec php \ - composer require --dev symfony/test-pack symfony/http-client justinrainbow/json-schema +docker compose exec php \ + composer require --dev symfony/test-pack symfony/http-client justinrainbow/json-schema ``` Your API is ready to be functionally tested. Create your test classes under the `tests/` directory. @@ -233,7 +233,7 @@ There is one caveat though: in some tests, it is necessary to perform multiple r All you have to do now is to run your tests: ```console -docker-compose exec php \ +docker compose exec php \ bin/phpunit ``` diff --git a/schema-generator/getting-started.md b/schema-generator/getting-started.md index 217e9b7c10e..5dbed0d76b0 100644 --- a/schema-generator/getting-started.md +++ b/schema-generator/getting-started.md @@ -6,7 +6,7 @@ If you use [the API Platform distribution](../distribution/index.md), the Schema dependency of your project and can be invoked through Docker: ```console -docker-compose exec php \ +docker compose exec php \ vendor/bin/schema ``` @@ -104,7 +104,7 @@ vendor/bin/schema generate api/src/ api/config/schema.yaml -vv Using [the API Platform Distribution](../distribution/index.md): ```console -docker-compose exec php \ +docker compose exec php \ vendor/bin/schema generate src/ config/schema.yaml -vv ```