Skip to content
Open
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ A similar setup is provided for MySQL and PostgreSQL if a persistent database co
You can start MySQL or PostgreSQL locally with whatever installer works for your OS or use docker:

```bash
docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:9.1
docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:8.4
```

or

```bash
docker run -e POSTGRES_USER=petclinic -e POSTGRES_PASSWORD=petclinic -e POSTGRES_DB=petclinic -p 5432:5432 postgres:17.0
docker run -e POSTGRES_USER=petclinic -e POSTGRES_PASSWORD=petclinic -e POSTGRES_DB=petclinic -p 5432:5432 postgres:16.1
```

Further documentation is provided for [MySQL](https://github.com/spring-projects/spring-petclinic/blob/main/src/main/resources/db/mysql/petclinic_db_setup_mysql.txt)
Expand Down Expand Up @@ -158,7 +158,7 @@ Here is a list of them:
The [issue tracker](https://github.com/spring-projects/spring-petclinic/issues) is the preferred channel for bug reports, feature requests and submitting pull requests.

For pull requests, editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at <https://editorconfig.org>. All commits must include a __Signed-off-by__ trailer at the end of each commit message to indicate that the contributor agrees to the Developer Certificate of Origin.
For additional details, please refer to the blog post [Hello DCO, Goodbye CLA: Simplifying Contributions to Spring](https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring).
For additional details, please refer to the blog post [Hello DCO, Goodbye CLA: Simplifying Contributions to Spring](https://spring.io/blog/2023/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring).

## License

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mysql:
image: mysql:9.1
image: mysql:8.4
ports:
- "3306:3306"
environment:
Expand All @@ -12,7 +12,7 @@ services:
volumes:
- "./conf.d:/etc/mysql/conf.d:ro"
postgres:
image: postgres:17.0
image: postgres:16.1
ports:
- "5432:5432"
environment:
Expand Down
2 changes: 1 addition & 1 deletion k8s/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
app: demo-db
spec:
containers:
- image: postgres:17
- image: postgres:16.1
name: postgresql
env:
- name: POSTGRES_USER
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/db/mysql/petclinic_db_setup_mysql.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@

--------------------------------------------------------------------------------

1) Download and install the MySQL database (e.g., MySQL Community Server 5.1.x),
1) Download and install the MySQL database (e.g., MySQL Community Server 8.x),
which can be found here: https://dev.mysql.com/downloads/. Or run the
"docker-compose.yml" from the root of the project (if you have docker installed
locally):

$ docker-compose up
$ docker compose up
...
mysql_1_eedb4818d817 | MySQL init process done. Ready for start up.
...

2) (Once only) create the PetClinic database and user by executing the "db/mysql/user.sql"
scripts. You can connect to the database running in the docker container using
`mysql -u root -h localhost --protocol tcp`, but you don't need to run the script there
because the petclinic user is already set up if you use the provided `docker-compose.yml`.
because the petclinic user is already set up if you use the provided Docker Compose configuration.

3) Run the app with `spring.profiles.active=mysql` (e.g. as a System property via the command
line, but any way that sets that property in a Spring Boot app should work). For example use
mvn spring-boot:run -Dspring-boot.run.profiles=mysql

./mvnw spring-boot:run -Dspring-boot.run.profiles=mysql

To activate the profile on the command line.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

--------------------------------------------------------------------------------

1) Run the "docker-compose.yml" from the root of the project:
1) Run the Docker Compose configuration from the root of the project:

$ docker-compose up
$ docker compose up
...
spring-petclinic-postgres-1 | The files belonging to this database system will be owned by user "postgres".
...

2) Run the app with `spring.profiles.active=postgres` (e.g. as a System property via the command
line, but any way that sets that property in a Spring Boot app should work). For example use

mvn spring-boot:run -Dspring-boot.run.profiles=postgres
./mvnw spring-boot:run -Dspring-boot.run.profiles=postgres

To activate the profile on the command line.
Loading