mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-25 09:05:50 +00:00
Introduce ergomake
This commit is contained in:
parent
0962ed7e8f
commit
0b3147965f
2 changed files with 53 additions and 0 deletions
8
.ergomake/Dockerfile
Normal file
8
.ergomake/Dockerfile
Normal file
|
@ -0,0 +1,8 @@
|
|||
FROM openjdk:18
|
||||
ARG DATABASE
|
||||
WORKDIR app
|
||||
COPY . .
|
||||
RUN /app/mvnw package -DskipTests
|
||||
EXPOSE 8080
|
||||
ENV DATABASE ${DATABASE}
|
||||
CMD sh -c 'java -jar -Dspring.profiles.active=$DATABASE /app/target/*.jar'
|
45
.ergomake/docker-compose.yml
Normal file
45
.ergomake/docker-compose.yml
Normal file
|
@ -0,0 +1,45 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
postgres-app:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: .ergomake/Dockerfile
|
||||
args:
|
||||
- DATABASE=postgres
|
||||
ports:
|
||||
- "8081:8080"
|
||||
environment:
|
||||
- POSTGRES_URL=jdbc:postgresql://postgres/petclinic
|
||||
- POSTGRES_USER=petclinic
|
||||
- POSTGRES_PASS=petclinic
|
||||
mysql-app:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: .ergomake/Dockerfile
|
||||
args:
|
||||
- DATABASE=mysql
|
||||
ports:
|
||||
- "8082:8080"
|
||||
environment:
|
||||
- MYSQL_URL=jdbc:mysql://mysql/petclinic
|
||||
- MYSQL_USER=petclinic
|
||||
- MYSQL_PASS=petclinic
|
||||
mysql:
|
||||
image: mysql
|
||||
ports:
|
||||
- "3306"
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=
|
||||
- MYSQL_ALLOW_EMPTY_PASSWORD=true
|
||||
- MYSQL_USER=petclinic
|
||||
- MYSQL_PASSWORD=petclinic
|
||||
- MYSQL_DATABASE=petclinic
|
||||
postgres:
|
||||
image: postgres
|
||||
ports:
|
||||
- "5432"
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=petclinic
|
||||
- POSTGRES_USER=petclinic
|
||||
- POSTGRES_DB=petclinic
|
Loading…
Reference in a new issue