diff --git a/Docker-compose.yml b/Docker-compose.yml new file mode 100644 index 0000000..760c150 --- /dev/null +++ b/Docker-compose.yml @@ -0,0 +1,20 @@ +version: "3" +services: + redis: + platform: linux/amd64 + container_name: puddy-cache + hostname: redis + image: minwcho/puddy-cache:0.0.1 + ports: + - "6379:6379" + puddy: + image: minwcho/puddy-backend:0.0.1 + platform: linux/amd64 + build: + context: . + dockerfile: Dockerfile + container_name: puddy-backend + ports: + - "8080:8080" + depends_on: + - redis \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..494ecaa --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM openjdk:17 +COPY /build/libs/puddy-0.0.1-SNAPSHOT.jar app.jar +ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=prod"] \ No newline at end of file diff --git a/build.gradle b/build.gradle index 0e1d24a..0eece4a 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' developmentOnly 'org.springframework.boot:spring-boot-devtools' - runtimeOnly 'com.mysql:mysql-connector-j' + runtimeOnly 'com.mysql:mysql-connector-j:8.0.33' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..9263b0c --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +chmod +x ./gradlew +./gradlew build \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..8e6c860 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,2 @@ +docker compose build +docker compose push \ No newline at end of file diff --git a/src/main/java/sideproject/puddy/model/Match.java b/src/main/java/sideproject/puddy/model/Match.java index 1160fa2..0366481 100644 --- a/src/main/java/sideproject/puddy/model/Match.java +++ b/src/main/java/sideproject/puddy/model/Match.java @@ -9,10 +9,11 @@ @Entity @Getter +@Table(name = "matching") @NoArgsConstructor(access= AccessLevel.PROTECTED) public class Match { @Id - @GeneratedValue(strategy = GenerationType.AUTO) + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @ManyToOne @JoinColumn(name = "sender_id")