Introduce ergomake

This commit is contained in:
Lucas Vieira 2023-04-04 14:02:01 -03:00 committed by Lucas Fernandes da Costa
parent 0962ed7e8f
commit 0b3147965f
2 changed files with 53 additions and 0 deletions

8
.ergomake/Dockerfile Normal file
View 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'

View 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