Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ergomake #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .ergomake/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 changes: 45 additions & 0 deletions .ergomake/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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