Skip to content

Commit

Permalink
Merge pull request #90 from zeze1004/chore/setting-dev-profile
Browse files Browse the repository at this point in the history
[#89] 개발 배포스크립트 수정
  • Loading branch information
zeze1004 authored May 14, 2024
2 parents 7c42426 + 48c6772 commit 40ff6c6
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 2 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions init.sql
Original file line number Diff line number Diff line change
@@ -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)
);
27 changes: 27 additions & 0 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.

0 comments on commit 40ff6c6

Please sign in to comment.