Introduce ergomake

This commit is contained in:
Lucas Vieira 2023-04-04 14:02:01 -03:00
parent 0962ed7e8f
commit bba30542b1
2 changed files with 60 additions and 0 deletions

7
.ergomake/Dockerfile Normal file
View file

@ -0,0 +1,7 @@
FROM openjdk:18
ARG DATABASE
WORKDIR app
COPY . .
EXPOSE 8080
ENV DATABASE ${DATABASE}
CMD sh -c '/app/mvnw spring-boot:run -Dspring-boot.run.profiles=$DATABASE'

View file

@ -0,0 +1,53 @@
version: '3.8'
services:
h2-app:
build:
context: ..
dockerfile: .ergomake/Dockerfile
args:
- DATABASE=h2
ports:
- "8080:8080"
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