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