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/";