Skip to content

Commit 7a598e9

Browse files
committed
Rename docker-compose.yml in compose.yaml
1 parent e7a5cfb commit 7a598e9

File tree

6 files changed

+30
-55
lines changed

6 files changed

+30
-55
lines changed

core/mongodb.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ docker compose build php
4343
Add a MongoDB image to the docker-compose file:
4444

4545
```yaml
46-
# docker-compose.yml
47-
# ...
46+
# compose.yaml
47+
48+
services:
49+
# ...
4850
db-mongodb:
4951
# In production, you may want to use a managed database service
5052
image: mongo

core/performance.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,11 @@ Blackfire.io allows you to monitor the performance of your applications. For mor
355355

356356
To configure Blackfire.io follow these simple steps:
357357

358-
1. Add the following to your `docker-compose.override.yml` file:
358+
1. Add the following to your `compose.override.yaml` file:
359359

360360
```yaml
361+
services:
362+
# ...
361363
blackfire:
362364
image: blackfire/blackfire:2
363365
environment:

deployment/docker-compose.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ SERVER_NAME=your-domain-name.example.com \
6868
APP_SECRET=ChangeMe \
6969
POSTGRES_PASSWORD=ChangeMe \
7070
CADDY_MERCURE_JWT_SECRET=ChangeThisMercureHubJWTSecretKey \
71-
docker compose -f docker-compose.yml -f docker-compose.prod.yml up --wait
71+
docker compose -f compose.yaml -f compose.prod.yaml up --wait
7272
```
7373

7474
Be sure to replace `your-domain-name.example.com` by your actual domain name and to set the values of `APP_SECRET`, `CADDY_MERCURE_JWT_SECRET` to cryptographically secure random values.
@@ -84,7 +84,7 @@ Alternatively, if you don't want to expose an HTTPS server but only an HTTP one,
8484
SERVER_NAME=:80 \
8585
APP_SECRET=ChangeMe \
8686
CADDY_MERCURE_JWT_SECRET=ChangeThisMercureHubJWTSecretKey \
87-
docker compose -f docker-compose.yml -f docker-compose.prod.yml up --wait
87+
docker compose -f -compose.yaml -f compose.prod.yaml up --wait
8888
```
8989

9090
## Deploying on Multiple Nodes

deployment/traefik.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This tutorial will help you to define your own routes for your client, API and more generally for your containers.
1010

11-
Use this custom API Platform `docker-compose.yml` file which implements ready-to-use Træfik container configuration. Override
11+
Use this custom API Platform `compose.yaml` file which implements ready-to-use Træfik container configuration. Override
1212
ports and add labels to tell Træfik to listen on the routes mentioned and redirect routes to a specified container.
1313

1414
A few points to note:
@@ -39,7 +39,7 @@ Then you edited your `admin/Dockerfile` and `client/Dockerfile` like this:
3939
After that, don't forget to re-build your containers
4040

4141
```yaml
42-
# docker-compose.yml
42+
# compose.yaml
4343
version: '3.4'
4444
4545
x-cache-from:
@@ -190,12 +190,12 @@ If your network is of type B, it may conflict with the Træfik sub-network.
190190

191191
## Going Further
192192

193-
As this Træfik configuration listens on 80 and 443 ports, you can run only 1 Træfik instance per server. However, you may want to run multiple API Platform projects on the same server. To deal with it, you'll have to externalize the Træfik configuration to another `docker-compose.yml` file, anywhere on your server.
193+
As this Træfik configuration listens on 80 and 443 ports, you can run only 1 Træfik instance per server. However, you may want to run multiple API Platform projects on the same server. To deal with it, you'll have to externalize the Træfik configuration to another `compose.yaml` file, anywhere on your server.
194194

195195
Here is a working example:
196196

197197
```yaml
198-
# /somewhere/docker-compose.yml
198+
# /somewhere/compose.yaml
199199
version: '3.4'
200200
201201
services:
@@ -224,10 +224,10 @@ networks:
224224
# Add other networks here
225225
```
226226

227-
Then update the `docker-compose.yml` file belonging to your API Platform projects:
227+
Then update the `compose.yaml` file belonging to your API Platform projects:
228228

229229
```diff
230-
# /anywhere/api-platform/docker-compose.yml
230+
# /anywhere/api-platform/compose.yaml
231231
version: '3.4'
232232
233233
x-cache:
@@ -438,7 +438,7 @@ RANDOM_UNIQUE_KEY=yourUniqueKeyForYourSecondInstance
438438
Then update each traefik http routers names and services following this sample for admin
439439

440440
```yaml
441-
# /anywhere/first/api-plaform/docker-compose.yml
441+
# /anywhere/first/api-plaform/compose.yaml
442442
# ...
443443
labels:
444444
- traefik.http.routers.admin-${RANDOM_UNIQUE_KEY}.rule=Host(`admin.${DOMAIN_NAME}`)
@@ -450,7 +450,7 @@ Then update each traefik http routers names and services following this sample f
450450
Here is a fully working sample for Træfik generic config with a little script using docker-compose override approach.
451451
We assume that you've set `EXPOSE 3000` in your client and admin Dockerfile.
452452

453-
Create a new `init-dc.sh` which contains the generation code that will be written in `docker-compose.override.yaml` file.
453+
Create a new `init-dc.sh` which contains the generation code that will be written in `compose.override.yaml` file.
454454

455455
```bash
456456
#!/bin/sh
@@ -475,7 +475,7 @@ for k in "${services[@]}" ; do
475475
"
476476
done
477477
478-
echo "$text" > ./docker-compose.override.yml
478+
echo "$text" > ./compose.override.yaml
479479
```
480480

481481
Write this minimal configuration into your `traefik.toml` file:
@@ -502,10 +502,10 @@ Write this minimal configuration into your `traefik.toml` file:
502502
address = ":443"
503503
```
504504

505-
Then after that update respectively your API Platform and Træfik `docker-compose.yml` following these examples below.
505+
Then after that update respectively your API Platform and Træfik `compose.yaml` following these examples below.
506506

507507
```yaml
508-
# /anywhere/api-platform/docker-compose.yml
508+
# /anywhere/api-platform/compose.yaml
509509
version: '3.4'
510510
511511
x-cache:
@@ -640,7 +640,7 @@ networks:
640640
```
641641

642642
```yaml
643-
# /anywhere/traefik/docker-compose.yml
643+
# /anywhere/traefik/compose.yaml
644644
version: '3.4'
645645
646646
x-network:

distribution/debugging.md

+6-37
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,11 @@ RUN set -eux; \
2727

2828
## Configure Xdebug with Docker Compose Override
2929

30-
Using an [override](https://docs.docker.com/compose/reference/overview/#specifying-multiple-compose-files) file named
31-
`docker-compose.override.yml` ensures that the production configuration remains untouched.
32-
33-
As an example, an override could look like this:
34-
35-
```yml
36-
version: "3.4"
37-
38-
services:
39-
php:
40-
build:
41-
target: api_platform_php_dev
42-
environment:
43-
# See https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host
44-
# See https://github.com/docker/for-linux/issues/264
45-
# The `remote_host` below may optionally be replaced with `remote_connect_back`
46-
# XDEBUG_MODE required for step debugging
47-
XDEBUG_MODE: debug
48-
# default port for Xdebug 3 is 9003
49-
# idekey=VSCODE if you are debugging with VSCode
50-
XDEBUG_CONFIG: >-
51-
client_host=host.docker.internal
52-
idekey=PHPSTORM
53-
# This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers`
54-
# Then PHPStorm will use the corresponding path mappings
55-
PHP_IDE_CONFIG: serverName=api-platform
56-
```
57-
58-
Note for Mac environments use the following:
59-
60-
```yml
61-
XDEBUG_CONFIG: >-
62-
idekey=PHPSTORM
63-
client_host=docker.for.mac.localhost
64-
```
30+
XDebug is shipped by default with the API Platform distribution.
31+
To enable it, run: `XDEBUG_MODE=debug docker compose up --wait`
6532

66-
In VSCode, alongside the default PHP configuration in `launch.json`, you'll need path mappings for the Docker image.
33+
If you are using VSCode, use the following `launch.json` to debug.
34+
Note that this configuration includes the path mappings for the Docker image.
6735

6836
```json
6937
{
@@ -83,7 +51,8 @@ In VSCode, alongside the default PHP configuration in `launch.json`, you'll need
8351
}
8452
```
8553

86-
Note: For Linux environments, the `client_host` setting of `host.docker.internal` will not work, you will need the actual local IP address of your computer.
54+
Note: On Linux, the `client_host` setting of `host.docker.internal` may not work.
55+
In this case you will need the actual local IP address of your computer.
8756

8857
## Troubleshooting
8958

extra/troubleshooting.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ On Windows, you can use `netstat`. This will give you all TCP/IP network connect
2424
netstat -a -b
2525
```
2626

27-
You can change the port to be used in the `docker-compose.yml` file (default is port 80).
27+
The same problem may occur for port 443. In this case, follow the same steps but replace 80 by 443.
28+
29+
You can change the port to be used in the `compose.yaml` file (default ports are 443 and 80).
2830

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

0 commit comments

Comments
 (0)