From 3dc7107c7d17233a6a60b1f65b725a4a7791e832 Mon Sep 17 00:00:00 2001 From: "sojung.kim" Date: Tue, 14 May 2024 18:20:37 +0900 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20DB=20=EC=B4=88=EA=B8=B0=ED=99=94?= =?UTF-8?q?=20=EC=84=B8=ED=8C=85=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose-dev.yml | 2 ++ init.sql | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 init.sql diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index bf0bb61..85bb558 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -17,6 +17,8 @@ services: MYSQL_ROOT_PASSWORD: root ports: - "3306:3306" + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql redis: image: redis:alpine command: redis-server --port 6379 diff --git a/init.sql b/init.sql new file mode 100644 index 0000000..7ea8948 --- /dev/null +++ b/init.sql @@ -0,0 +1,34 @@ +-- card 테이블 생성 +CREATE TABLE IF NOT EXISTS card ( + card_id INT NOT NULL PRIMARY KEY, + card_title VARCHAR(30) NOT NULL, + budget BIGINT, + deadline DATETIME, + card_status VARCHAR(10) NOT NULL +); + +-- cardboard 테이블 생성 +CREATE TABLE IF NOT EXISTS cardboard ( + cardboard_id INT NOT NULL PRIMARY KEY, + user_id INT NOT NULL, + card_ids JSON +); + +-- todo 테이블 생성 +CREATE TABLE IF NOT EXISTS todo ( + todo_id INT NOT NULL PRIMARY KEY, + todo_item VARCHAR(35) NOT NULL, + todo_check_status VARCHAR(10) NOT NULL, + card_id INT NOT NULL +); + +-- user 테이블 생성 +CREATE TABLE IF NOT EXISTS user ( + email VARCHAR(30) NOT NULL, + password VARCHAR(100) NOT NULL, + name VARCHAR(20) NOT NULL, + nick_name VARCHAR(20), + created_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + id INT NOT NULL PRIMARY KEY, + partner_email VARCHAR(30) +); From d0c31ba5fb27619c88e26845a5e789c19031e3e6 Mon Sep 17 00:00:00 2001 From: "sojung.kim" Date: Tue, 14 May 2024 18:22:14 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20dev=20=ED=94=84=EB=A1=9C=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 7 +++++-- src/main/resources/application-dev.yml | 27 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/application-dev.yml diff --git a/Dockerfile b/Dockerfile index dea331d..0e5bdbf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,5 +19,8 @@ WORKDIR /app # 빌드 스테이지에서 생성된 JAR 파일 복사 COPY --from=build /workspace/app/build/libs/wedding-0.0.1-SNAPSHOT.jar app.jar -# 애플리케이션 실행 -ENTRYPOINT ["java","-jar","app.jar"] +# init.sql 파일 복사 +COPY init.sql /docker-entrypoint-initdb.d/init.sql + +# 애플리케이션 실행 시 dev 프로파일 활성화 +ENTRYPOINT ["java", "-Dspring.profiles.active=dev", "-jar", "app.jar"] diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..c6cc67f --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,27 @@ +spring: + config: + activate: + on-profile: dev + datasource: + url: jdbc:mysql://mysql:3306/wedding + + session: + store-type: redis + data: + redis: + host: redis + port: 6379 + timeout: 1000 + lettuce: + pool: + max-active: 8 + max-wait: -1 + max-idle: 8 + min-idle: 0 + +mybatis: + mapper-locations: classpath:mapper/**/*.xml + type-aliases-package: org.wedding.* + configuration: + map-underscore-to-camel-case: true + type-handlers-package: org.wedding.adapter.out.persistence.mybatis From 48c677269100d10af5ac9eee1dc8d33342f6acb4 Mon Sep 17 00:00:00 2001 From: "sojung.kim" Date: Tue, 14 May 2024 18:22:45 +0900 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20local=20=EB=AA=85=EC=B9=AD=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/{application.yml => application-local.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/{application.yml => application-local.yml} (100%) diff --git a/src/main/resources/application.yml b/src/main/resources/application-local.yml similarity index 100% rename from src/main/resources/application.yml rename to src/main/resources/application-local.yml