-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f591565
commit 9b172b3
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
MYSQLDB_USER=root | ||
MYSQLDB_ROOT_PASSWORD=default | ||
MYSQLDB_DATABASE=book_store | ||
MYSQLDB_LOCAL_PORT=3308 | ||
MYSQLDB_DOCKER_PORT=3306 | ||
SPRING_LOCAL_PORT=8088 | ||
SPRING_DOCKER_PORT=8080 | ||
DEBUG_PORT=5005 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM openjdk:17-jdk-slim as builder | ||
WORKDIR application | ||
ARG JAR_FILE=target/*.jar | ||
COPY ${JAR_FILE} application.jar | ||
RUN java -Djarmode=layertools -jar application.jar extract | ||
|
||
FROM openjdk:17-jdk-slim | ||
WORKDIR application | ||
COPY --from=builder application/dependencies/ ./ | ||
COPY --from=builder application/spring-boot-loader/ ./ | ||
COPY --from=builder application/snapshot-dependencies/ ./ | ||
COPY --from=builder application/application/ ./ | ||
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] | ||
EXPOSE 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: "3.8" | ||
|
||
services: | ||
mysqldb: | ||
platform: linux/arm64 | ||
image: mysql:latest | ||
restart: unless-stopped | ||
env_file: ./.env | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=$MYSQLDB_ROOT_PASSWORD | ||
- MYSQL_DATABASE=$MYSQLDB_DATABASE | ||
ports: | ||
- $MYSQLDB_LOCAL_PORT:$MYSQLDB_DOCKER_PORT | ||
healthcheck: | ||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] | ||
timeout: 30s | ||
retries: 3 | ||
app: | ||
depends_on: | ||
mysqldb: | ||
condition: service_healthy | ||
restart: on-failure | ||
image: book_store | ||
build: . | ||
env_file: ./.env | ||
ports: | ||
- $SPRING_LOCAL_PORT:$SPRING_DOCKER_PORT | ||
- $DEBUG_PORT:$DEBUG_PORT | ||
environment: | ||
SPRING_APPLICATION_JSON: '{ | ||
"spring.datasource.url" : "jdbc:mysql://mysqldb:$MYSQLDB_DOCKER_PORT/$MYSQLDB_DATABASE", | ||
"spring.datasource.username" : "$MYSQLDB_USER", | ||
"spring.datasource.password" : "$MYSQLDB_ROOT_PASSWORD", | ||
"spring.jpa.properties.hibernate.dialect" : "org.hibernate.dialect.MySQLDialect", | ||
"spring.datasource.driver-class-name" : "com.mysql.cj.jdbc.Driver", | ||
"spring.jpa.hibernate.ddl-auto" : "validate" | ||
}' | ||
JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters