From 5793f450d508a29ffef547e45bf76c688606cf54 Mon Sep 17 00:00:00 2001 From: iancumatei67 Date: Fri, 26 Jan 2024 13:20:48 +0200 Subject: [PATCH] Created a docker compose file to run the application and database --- my-compose-file.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 my-compose-file.yml diff --git a/my-compose-file.yml b/my-compose-file.yml new file mode 100644 index 000000000..54f03c575 --- /dev/null +++ b/my-compose-file.yml @@ -0,0 +1,20 @@ +version: '3' + +services: + db: + image: mysql:latest + environment: + MYSQL_DATABASE: petclinic + MYSQL_USER: petclinic_user + MYSQL_PASSWORD: petclinic_password + MYSQL_ROOT_PASSWORD: root_password + app: + image: iancumatei67/spring-petclinic:v2 + ports: + - "8080:8080" + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/petclinic + SPRING_DATASOURCE_USERNAME: petclinic_user + SPRING_DATASOURCE_PASSWORD: petclinic_password + depends_on: + - db