I have configured a Firebase properties file as follows -
@Bean
Firestore firestore() throws IOException {
InputStream serviceAccount = new FileInputStream("my-karwaan-firebase-adminsdk.json");
GoogleCredentials credentials = GoogleCredentials.fromStream(serviceAccount);
JSON file is present under the resources folder.
Everything works fine on the localhost. But on docker it's throwing while running docker image
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate
[com.google.cloud.firestore.Firestore]: Factory method 'firestore' threw exception; nested
exception is java.io.FileNotFoundException: my-karwaan-firebase-adminsdk.json
Docker file content as follows -
# Build Jar File
FROM maven:3.6.3-jdk-8-slim as stage1
WORKDIR /home/app
COPY . /home/app
RUN mvn -f /home/app/pom.xml clean package
# Create an Image
FROM openjdk:8-jdk-alpine
EXPOSE 8080
COPY --from=stage1 /home/app/target/myapp.jar myapp.jar
ENTRYPOINT ["java", "-jar", "myapp.jar"]
I tried to give an absolute path but it's not working on docker.


dockerfile??