-
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.
Merge pull request #13 from AntonBabychP1T/order-feature
Add docker to project
- Loading branch information
Showing
10 changed files
with
110 additions
and
14 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,13 @@ | ||
MYSQL_USER=admin123 | ||
MYSQL_PASSWORD=password | ||
MYSQL_DATABASE=book_store | ||
MYSQL_ROOT_PASSWORD=password | ||
MYSQL_LOCAL_PORT=3307 | ||
MYSQL_DOCKER_PORT=3306 | ||
|
||
SPRING_LOCAL_PORT=8088 | ||
SPRING_DOCKER_PORT=8080 | ||
DEBUG_PORT=5005 | ||
|
||
JWT_EXPIRATION_TIME=5000000 | ||
JWT_SECRET=p1tbookstoreappsomerandomsymholstokey1231488p1t |
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,16 @@ | ||
# Builder stage | ||
FROM openjdk:17-jdk-alpine as builder | ||
WORKDIR application | ||
ARG JAR_FILE=target/*.jar | ||
COPY ${JAR_FILE} application.jar | ||
RUN java -Djarmode=layertools -jar application.jar extract | ||
|
||
# Final stage | ||
FROM openjdk:17-jdk-alpine | ||
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,37 @@ | ||
version: "3.8" | ||
|
||
services: | ||
mysqldb: | ||
image: mysql | ||
restart: unless-stopped | ||
env_file: ./.env | ||
ports: | ||
- $MYSQL_LOCAL_PORT:$MYSQL_DOCKER_PORT | ||
environment: | ||
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD | ||
MYSQL_DATABASE: $MYSQL_DATABASE | ||
MYSQL_USER: $MYSQL_USER | ||
MYSQL_PASSWORD: $MYSQL_PASSWORD | ||
|
||
app: | ||
depends_on: | ||
- mysqldb | ||
restart: on-failure | ||
image: book-store-app | ||
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:3306/$MYSQL_DATABASE?createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC", | ||
"spring.datasource.username" : "$MYSQL_USER", | ||
"spring.datasource.password" : "$MYSQL_PASSWORD", | ||
"spring.datasource.driver-class-name" : "com.mysql.cj.jdbc.Driver", | ||
"spring.jpa.hibernate.ddl-aut" : "validate", | ||
"spring.jpa.show-sql" : "true", | ||
"jwt.expiration" : "$JWT_EXPIRATION_TIME", | ||
"jwt_secret" : "$JWT_SECRET" | ||
}' | ||
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
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
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
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 |
---|---|---|
@@ -1,12 +1,6 @@ | ||
spring.datasource.url=jdbc:mysql://localhost:3306/book_store | ||
spring.datasource.username=root | ||
spring.datasource.password=password | ||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver | ||
|
||
spring.jpa.hibernate.ddl-auto=validate | ||
spring.jpa.show-sql=true | ||
|
||
jwt.expiration=1000000 | ||
jwt.secret=p1tbookstoreappsomerandomsymholstokey1231488p1t | ||
|
||
|
27 changes: 27 additions & 0 deletions
27
src/main/resources/db/changelog/changes/14-set-shopping-cart-to-existing-user.yaml
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,27 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: 1-add-shopping-cart-to-default-user | ||
author: antonbabych | ||
changes: | ||
- insert: | ||
tableName: shopping_cards | ||
columns: | ||
- column: | ||
name: user_id | ||
valueNumeric: 1 | ||
- column: | ||
name: is_deleted | ||
value: 0 | ||
- changeSet: | ||
id: 2-add-shopping-cart-to-default-admin | ||
author: antonbabych | ||
changes: | ||
- insert: | ||
tableName: shopping_cards | ||
columns: | ||
- column: | ||
name: user_id | ||
valueNumeric: 2 | ||
- column: | ||
name: is_deleted | ||
value: 0 |
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
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 |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
class BookStoreAppApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
void contextLoads(){ | ||
} | ||
|
||
} |