Update docker-compose.yml to version 2.2

The current docker-compose.yml is still in version 1, which is
deprecated: https://docs.docker.com/compose/compose-file/compose-versioning/

So if you try to run `docker-compose up` with a recent version of
docker-compose, the following error occurs:
    (root) Additional property mysql is not allowed

Version 2.2 was chosen because it's not deprecated, but it also has been
released some time ago: Compose version 2.2 requires docker engine
version 1.13.0, which was released on 2017-01-18. So, with this version,
hopefully no users will have any issues either with deprecation warnings
or with a version that is not yet supported by their docker-engine.
This commit is contained in:
Fabian Muscariello 2021-12-05 16:24:03 +01:00 committed by Dave Syer
parent eff7c9529f
commit 20adfb71be

View file

@ -1,12 +1,15 @@
mysql: version: "2.2"
image: mysql:5.7
ports: services:
- "3306:3306" mysql:
environment: image: mysql:5.7
- MYSQL_ROOT_PASSWORD= ports:
- MYSQL_ALLOW_EMPTY_PASSWORD=true - "3306:3306"
- MYSQL_USER=petclinic environment:
- MYSQL_PASSWORD=petclinic - MYSQL_ROOT_PASSWORD=
- MYSQL_DATABASE=petclinic - MYSQL_ALLOW_EMPTY_PASSWORD=true
volumes: - MYSQL_USER=petclinic
- "./conf.d:/etc/mysql/conf.d:ro" - MYSQL_PASSWORD=petclinic
- MYSQL_DATABASE=petclinic
volumes:
- "./conf.d:/etc/mysql/conf.d:ro"