From 054b62c3ea68d445eb0b9c2a9ff93f5457e2bcc8 Mon Sep 17 00:00:00 2001 From: Hyeok_Choi Date: Thu, 14 Dec 2023 16:01:10 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20prod=20file=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EB=8F=84=EC=BB=A4=20=EB=B3=BC?= =?UTF-8?q?=EB=A5=A8=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/prod_cd.yaml | 2 +- .../aplus/insurancesystem/common/service/JavaFileService.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prod_cd.yaml b/.github/workflows/prod_cd.yaml index b9299cd..817796c 100644 --- a/.github/workflows/prod_cd.yaml +++ b/.github/workflows/prod_cd.yaml @@ -54,4 +54,4 @@ jobs: docker rm insurance_system_prod docker rmi choihyeok/insurance_system_prod docker pull choihyeok/insurance_system_prod - docker run -d -p 8080:8080 --name insurance_system_prod choihyeok/insurance_system_prod \ No newline at end of file + docker run -d -p 8080:8080 -v file_volume:/app/files --name insurance_system_prod choihyeok/insurance_system_prod \ No newline at end of file diff --git a/src/main/java/aplus/insurancesystem/common/service/JavaFileService.java b/src/main/java/aplus/insurancesystem/common/service/JavaFileService.java index a5f078d..c47855d 100644 --- a/src/main/java/aplus/insurancesystem/common/service/JavaFileService.java +++ b/src/main/java/aplus/insurancesystem/common/service/JavaFileService.java @@ -21,7 +21,9 @@ public class JavaFileService implements FileService{ private final String FILE_PATH; public JavaFileService(@Value("${spring.profiles.active}") String activeProfile) { - if (activeProfile.equals("test")) { + if (activeProfile.equals("prod")) { + FILE_PATH = "/app/files/"; + } else if (activeProfile.equals("test")) { FILE_PATH = "/home/worker/files/"; } else { FILE_PATH = System.getProperty("user.dir") + "/files/";