Add deployment automation scripts and configuration

This commit is contained in:
samanthayeep 2024-08-29 22:11:19 +08:00
parent 3510815b58
commit 4cf9ecf251
4 changed files with 19 additions and 22 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
.github/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -1,4 +1,4 @@
FROM openjdk:17-jdk-slim
COPY target/spring-petclinic-*.jar /app/spring-petclinic.jar
ENTRYPOINT ["java", "-jar", "/app/spring-petclinic.jar"]
FROM mysql:8.0

View file

@ -1,25 +1,22 @@
services:
mysql:
image: mysql:8.4
petclinic:
image: samanthayeep/petclinic:latest
ports:
- "3306:3306"
- "8082:8082"
depends_on:
- db
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_ALLOW_EMPTY_PASSWORD=true
- MYSQL_USER=petclinic
- MYSQL_PASSWORD=petclinic
- MYSQL_DATABASE=petclinic
volumes:
- "./conf.d:/etc/mysql/conf.d:ro"
profiles:
- mysql
postgres:
image: postgres:16.3
- SPRING_PROFILES_ACTIVE=dev
- DATABASE_URL=jdbc:mysql://db:3307/petclinic
- DATABASE_USERNAME=petclinic
- DATABASE_PASSWORD=petclinicpassword
db:
image: my-mysql-image
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: petclinic
MYSQL_USER: petclinic
MYSQL_PASSWORD: petclinicpassword
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=petclinic
- POSTGRES_USER=petclinic
- POSTGRES_DB=petclinic
profiles:
- postgres
- "3307:3306"