mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 07:15:49 +00:00
Split compose files into - test enviroment (db + app) and main compose (app + rds connection string)
This commit is contained in:
parent
989924ce81
commit
57b4a42434
2 changed files with 26 additions and 22 deletions
25
compose-test.yaml
Normal file
25
compose-test.yaml
Normal file
|
@ -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:
|
21
compose.yaml
21
compose.yaml
|
@ -4,26 +4,5 @@ services:
|
||||||
context: .
|
context: .
|
||||||
ports:
|
ports:
|
||||||
- 80:8080
|
- 80:8080
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: service_healthy
|
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_URL=jdbc:mysql://petclinic:petclinic@db:3306/petclinic
|
- 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:
|
|
||||||
|
|
Loading…
Reference in a new issue