Skip to content

Fix renamed Docker Compose service "web" or "php" to "app" #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
2 changes: 1 addition & 1 deletion deployment/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ stack is shipped with the API Platform distribution.
To install it, run the following commands (Docker must be installed on your system):

$ docker-compose up -d # Download, build and run Docker images
$ docker-compose exec php bin/console doctrine:schema:create # Create the MySQL schema
$ docker-compose exec app bin/console doctrine:schema:create # Create the MySQL schema

Your project will be accessible at the URL `http://127.0.0.1`.

Expand Down
18 changes: 9 additions & 9 deletions distribution/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ almost everything.
The API Platform Standard Edition comes with a dummy entity for test purpose: `src/AppBundle/Entity/Foo.php`. We will remove
it later, but for now, create the related database table:

$ docker-compose exec php bin/console doctrine:schema:create
$ docker-compose exec app bin/console doctrine:schema:create

The `php` container is where your project stands. Prefixing a command by `docker-compose exec php` allows to execute the
The `app` container is where your project stands. Prefixing a command by `docker-compose exec app` allows to execute the
given command in the container. You may want [to create an alias](http://www.linfo.org/alias.html) to easily run commands
inside the container.

Expand All @@ -94,14 +94,14 @@ Instead of using Docker, API Platform can also be installed on the local machine
$ composer create-project api-platform/api-platform bookshop-api

Then, enter the project folder, create the database and its schema:

$ cd bookshop-api
$ php bin/console doctrine:database:create
$ php bin/console doctrine:schema:create
$ bin/console doctrine:database:create
$ bin/console doctrine:schema:create

And start the server:
$ php bin/console server:run

$ bin/console server:run

## It's ready!

Expand Down Expand Up @@ -287,12 +287,12 @@ or in Kévin's book "[Persistence in PHP with the Doctrine ORM](https://www.amaz
As we used private properties (but API Platform as well as Doctrine can also work with public ones), we need to create the
corresponding accessor methods. Run the following command or use the code generation feature of your IDE to generate them:

$ docker-compose exec php bin/console doctrine:generate:entities AppBundle
$ docker-compose exec app bin/console doctrine:generate:entities AppBundle

Then, delete the file `src/AppBundle/Entity/Foo.php`, this demo entity isn't useful anymore.
Finally, tell Doctrine to sync the database's tables structure with our new data model:

$ docker-compose exec php bin/console doctrine:schema:update --force
$ docker-compose exec app bin/console doctrine:schema:update --force

We now have a working data model that you can persist and query. To create an API endpoint with CRUD capabilities corresponding
to an entity class, we just have to mark it with an annotation called `@ApiResource`:
Expand Down
4 changes: 2 additions & 2 deletions distribution/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ The API Platform flavor of Behat also comes with a temporary SQLite database ded

Clear the cache of the `test` environment:

$ docker-compose php web bin/console cache:clear --env=test
$ docker-compose app bin/console cache:clear --env=test

Then run:

$ docker-compose run --rm php vendor/bin/behat`.
$ docker-compose run --rm app vendor/bin/behat`.

Everything should be green now. Your Linked Data API is now specified and tested thanks to Behat!

Expand Down
6 changes: 3 additions & 3 deletions schema-generator/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

If you use [the official distribution of API Platform](../distribution/index.md), the Schema Generator is already installed as a development dependency of your project and can be invoked through Docker:

$ docker-compose exec php vendor/bin/schema
$ docker-compose exec app vendor/bin/schema

The Schema Generator can also [be downloaded independently as a PHAR](https://github.com/api-platform/schema-generator/releases) or installed in an existing project using [Composer](https://getcomposer.org):

Expand Down Expand Up @@ -53,7 +53,7 @@ types:

Run the generator with this config file as parameter:

$ docker-compose exec php vendor/bin/schema generate-types src/ app/config/schema.yml
$ docker-compose exec app vendor/bin/schema generate-types src/ app/config/schema.yml

The following classes will be generated:

Expand Down Expand Up @@ -745,7 +745,7 @@ When cardinality cannot be automatically extracted, it's value is set to `unknow

Usage:

$ docker-compose exec php vendor/bin/schema extract-cardinalities
$ docker-compose exec app vendor/bin/schema extract-cardinalities

Previous chapter: [Introduction](index.md)

Expand Down
6 changes: 3 additions & 3 deletions troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This is a list of common pitfalls on using API Platform, and how to avoid them.
If you get errors like the following when running `docker-compose up` on Windows:

```
ERROR: for web Cannot create container for service web: Invalid bind mount spec "C:\\Users\\Kevin\\api-platform:/app:rw": Invalid volume specification: 'C:\Users\Kevin\api-platform:/app:rw'
ERROR: for app Cannot create container for service app: Invalid bind mount spec "C:\\Users\\Kevin\\api-platform:/srv/api-platform:rw": Invalid volume specification: 'C:\Users\Kevin\api-platform:/srv/api-platform:rw'
←[31mERROR←[0m: Encountered errors while bringing up the project.
```

Expand All @@ -21,9 +21,9 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1

### Error starting userland proxy

If the web container cannot start and display this `Error starting userland proxy: Bind for 0.0.0.0:80`, it means that the port 80 is already used.
If the `app` container cannot start and display this `Error starting userland proxy: Bind for 0.0.0.0:80`, it means that port 80 is already in use.

The configuration docker is planned to be launch on the port 80 in the `docker-compose.yml` file.
You can change the port to be used in the `docker-compose.yml` file (default is port 80).

## Using API Platform and JMS Serializer in the same project

Expand Down