Image error solve update

This commit is contained in:
2025-10-10 19:15:32 +05:30
parent 0ad84e030a
commit f5210206f6

View File

@ -17,9 +17,8 @@ COPY src ./src
# Build the application
RUN mvn package -B -T 1C -DskipTests -Dmaven.javadoc.skip=true
# Verify the JAR was created and rename it to a consistent name
RUN ls -la target/ && \
mv target/*.jar target/app.jar
# Verify the JAR was created
RUN ls -la target/
# =======================
# Runtime stage
@ -37,12 +36,11 @@ RUN mkdir -p /app && \
# Set working directory
WORKDIR /app
# Copy the JAR with a consistent name
COPY --from=builder /workdir/server/target/app.jar /app/app.jar
# Copy the JAR from builder stage
COPY --from=builder /workdir/server/target/*.jar /app/
# Create volume for uploads
# Create volume for uploads (optional but recommended)
VOLUME ["/app/uploads"]
# Use exec form of ENTRYPOINT (not shell form) for proper signal handling
# and environment variable passing
ENTRYPOINT ["java", "-jar", "/app/app.jar"]
# Entry point: dynamically run the first JAR in /app
ENTRYPOINT ["sh", "-c", "java -jar /app/$(ls /app | grep .jar | head -n1)"]