diff --git a/src/main/java/com/onnoff/onnoff/config/FirebaseConfig.java b/src/main/java/com/onnoff/onnoff/config/FirebaseConfig.java index 70a9fc0..39a4b7c 100644 --- a/src/main/java/com/onnoff/onnoff/config/FirebaseConfig.java +++ b/src/main/java/com/onnoff/onnoff/config/FirebaseConfig.java @@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; + +import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -25,8 +27,7 @@ public class FirebaseConfig { @PostConstruct public void initialize() { try { - ClassPathResource resource = new ClassPathResource(firebaseSdkPath); - InputStream serviceAccount = resource.getInputStream(); + InputStream serviceAccount = new FileInputStream(firebaseSdkPath); FirebaseOptions options = FirebaseOptions.builder() .setCredentials(GoogleCredentials.fromStream(serviceAccount)) .build(); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 96e3d44..0eb1f6c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -26,6 +26,6 @@ kakao: client-id: ${KAKAO_CLIENT_ID} admin-key: ${KAKAO_ADMIN_KEY} fcm: - firebase-sdk-path : ${FIREBASE_SDK_PATH} + firebase-sdk-path : /var/app/current/src/main/resources/${FIREBASE_SDK_PATH} project-id : ${FIREBASE_PROJECT_ID}