Aminu Babayo Shehu
12/29/2022, 6:47 PMDockerfile
but when I try to upload image and read file I’m getting error of file or directory not found
BUT in reality the directory exist or file do existAminu Babayo Shehu
12/29/2022, 6:47 PM# Use the official gradle image to create a build artifact.
FROM gradle:7-jdk11 as builder
# Copy local code to the container image.
COPY build.gradle.kts .
COPY gradle.properties .
COPY src ./src
COPY uploads ./uploads
# Build a release artifact.
RUN gradle installDist
FROM openjdk:11
EXPOSE 7002:7002
RUN mkdir /app
COPY --from=builder /home/gradle/build/install/gradle /app/
WORKDIR /app/bin
CMD ["./gradle"]
Chris Lee
12/29/2022, 8:46 PM./gradlew
?Chris Lee
12/29/2022, 8:47 PMAminu Babayo Shehu
12/29/2022, 8:49 PM.gradle
Aminu Babayo Shehu
12/29/2022, 8:49 PMuploads
inside the root folderChris Lee
12/29/2022, 8:50 PMAminu Babayo Shehu
12/29/2022, 8:51 PMAminu Babayo Shehu
12/29/2022, 8:54 PM2022-12-29 11:13:31.611 [eventLoopGroupProxy-4-2] DEBUG ktor.application - Unhandled: POST - /dashboard/profile/update. Exception class java.io.FileNotFoundException: uploads/Rlmdw31o9PDkeconaUCxD4k3eiz5ZX.png (No such file or directory)]
java.io.FileNotFoundException: uploads/Rlmdw31o9PDkeconaUCxD4k3eiz5ZX.png (No such file or directory)
Aminu Babayo Shehu
12/29/2022, 8:54 PMuploads
directoryChris Lee
12/29/2022, 8:55 PMuploads
- generally cleanest to configure with an absolute path to avoid issues like this, where the working directory isn’t that is expected.Aminu Babayo Shehu
12/29/2022, 8:57 PMChris Lee
12/29/2022, 8:57 PMAminu Babayo Shehu
12/29/2022, 8:59 PMDockerfile
?