Skip to content

Commit dcff528

Browse files
committed
rename docker-compose.yml to compose.yaml
Use the modern canonical name from the Compose Spec. Update all references in README and application.yml comments.
1 parent 6f79d6f commit dcff528

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ natively. The port numbers on the diagram are the same for Docker on Linux.
5757

5858
### Volumes, Configs, and Network
5959

60-
We will break down the [docker-compose.yml](docker-compose.yml) into parts and explain how
60+
We will break down the [compose.yaml](compose.yaml) into parts and explain how
6161
each part works.
6262

6363
```yaml
@@ -76,7 +76,7 @@ settings across container restarts.
7676

7777
Docker Compose v2.23.1+ supports inline config files using the top-level `configs` section
7878
with a `content` field. This lets you define small configuration files directly inside
79-
`docker-compose.yml` instead of maintaining separate files on disk. Compose mounts the
79+
`compose.yaml` instead of maintaining separate files on disk. Compose mounts the
8080
content as a read-only file inside the container at the path specified by `target`.
8181

8282
```yaml
@@ -114,11 +114,11 @@ Docker compose will automatically create a single network that all the container
114114
to and register them in DNS using the docker compose service name. This means that the pgAdmin
115115
container can find the postgres server using its docker-compose service name which is `postgres`.
116116
Docker compose derives the network name from the directory name containing the
117-
`docker-compose.yml` file. In this example the network name is `docker-compose-postgres_default`.
117+
`compose.yaml` file. In this example the network name is `docker-compose-postgres_default`.
118118

119119
### PostgreSQL Container
120120

121-
The `docker-compose.yml` contains a service named `postgres` defined below.
121+
The `compose.yaml` contains a service named `postgres` defined below.
122122

123123
```yml
124124
services:
@@ -163,7 +163,7 @@ The `demo1` database does not have pgvector enabled, keeping it as a standard Po
163163
database for the Spring Boot sample application.
164164

165165
To switch back to standard PostgreSQL without pgvector, swap the image lines in
166-
`docker-compose.yml`:
166+
`compose.yaml`:
167167

168168
```yaml
169169
image: "postgres:18"
@@ -315,7 +315,7 @@ shown below.
315315
<img src="diagrams/pgAdminConnect.png" width="400" height="500" title="PgAdmin">
316316

317317
To avoid having to enter the connection settings we define the connection details using an
318-
inline config in `docker-compose.yml` that pgAdmin will import into its configuration.
318+
inline config in `compose.yaml` that pgAdmin will import into its configuration.
319319
Setting `PGADMIN_REPLACE_SERVERS_ON_STARTUP: "True"` ensures the server definitions are
320320
reloaded on every container restart, not just the first launch.
321321
@@ -471,7 +471,7 @@ to `localhost:8080/` should return a random quote similar to the one below
471471
Spring Boot 3.1 introduced built-in Docker Compose support via the `spring-boot-docker-compose`
472472
dependency. When you run `./mvnw spring-boot:run`, Spring Boot automatically:
473473

474-
1. Detects the `docker-compose.yml` in the project directory
474+
1. Detects the `compose.yaml` in the project directory
475475
2. Starts the containers if they aren't already running
476476
3. Reads each container's labels, ports, and environment variables
477477
4. Auto-configures connection details (datasource URL, username, password, database name)
@@ -491,7 +491,7 @@ services:
491491
This label tells Spring Boot that this container provides a PostgreSQL service connection.
492492
Spring Boot reads the container's mapped port (which may vary if `PG_PORT` is customized)
493493
and the `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB` environment variables to
494-
configure the datasource automatically. Changing these values in `docker-compose.yml` is
494+
configure the datasource automatically. Changing these values in `compose.yaml` is
495495
the only step needed — no `application.yml` changes required.
496496

497497
The pgadmin service has a different label to opt out of this auto-configuration:
File renamed without changes.

src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
spring:
22
# The datasource url, username, and password are not needed here because
33
# spring-boot-docker-compose auto-configures them from the running postgres
4-
# container. The docker-compose.yml postgres service has the label
4+
# container. The compose.yaml postgres service has the label
55
# org.springframework.boot.service-connection: postgres which tells Spring Boot
66
# to read the container's mapped port, credentials, and database name
77
# (POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB) and configure the datasource
8-
# automatically. This means changing PG_PORT or credentials in docker-compose.yml
8+
# automatically. This means changing PG_PORT or credentials in compose.yaml
99
# works without touching this file.
1010
#
1111
# datasource:

0 commit comments

Comments
 (0)