From 57b4a424343e74d8b036f956add6556a59efb108 Mon Sep 17 00:00:00 2001 From: JustFiesta Date: Wed, 3 Jul 2024 12:12:47 +0200 Subject: [PATCH] Split compose files into - test enviroment (db + app) and main compose (app + rds connection string) --- compose-test.yaml | 25 +++++++++++++++++++++++++ compose.yaml | 23 +---------------------- 2 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 compose-test.yaml diff --git a/compose-test.yaml b/compose-test.yaml new file mode 100644 index 000000000..e50821d15 --- /dev/null +++ b/compose-test.yaml @@ -0,0 +1,25 @@ +services: + server: + build: + context: . + ports: + - 80:8080 + depends_on: + - db + environment: + - MYSQL_URL=jdbc:mysql://petclinic:petclinic@db:3306/petclinic + db: + image: mysql + restart: always + volumes: + - db-data:/var/lib/mysql + environment: + - MYSQL_RANDOM_ROOT_PASSWORD=yes + - MYSQL_DATABASE=petclinic + - MYSQL_USER=petclinic + - MYSQL_PASSWORD=petclinic + ports: + - 3306:3306 + +volumes: + db-data: diff --git a/compose.yaml b/compose.yaml index 9e13ad75e..bf77487ba 100644 --- a/compose.yaml +++ b/compose.yaml @@ -4,26 +4,5 @@ services: context: . ports: - 80:8080 - depends_on: - db: - condition: service_healthy environment: - - MYSQL_URL=jdbc:mysql://petclinic:petclinic@db:3306/petclinic - db: - image: mysql - restart: always - volumes: - - db-data:/var/lib/mysql - environment: - - MYSQL_DATABASE=petclinic - - MYSQL_USER=petclinic - - MYSQL_PASSWORD=petclinic - ports: - - 3306:3306 - healthcheck: - test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] - interval: 10s - timeout: 5s - retries: 5 -volumes: - db-data: + - MYSQL_URL=jdbc:mysql://petclinic:petclinic@db:3306/petclinic \ No newline at end of file