Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +6 -3
Dockerfile
CHANGED
|
@@ -9,8 +9,8 @@ WORKDIR /app
|
|
| 9 |
# Clone the Coral Server repository
|
| 10 |
RUN git clone https://github.com/Coral-Protocol/coral-server.git .
|
| 11 |
|
| 12 |
-
# Build the application
|
| 13 |
-
RUN ./gradlew
|
| 14 |
|
| 15 |
# Stage 2: Runtime
|
| 16 |
FROM eclipse-temurin:17-jre-alpine
|
|
@@ -20,8 +20,11 @@ RUN apk add --no-cache curl
|
|
| 20 |
|
| 21 |
WORKDIR /app
|
| 22 |
|
| 23 |
-
# Copy the built JAR
|
|
|
|
| 24 |
COPY --from=builder /app/build/libs/*.jar coral-server.jar
|
|
|
|
|
|
|
| 25 |
COPY --from=builder /app/src/main/resources /app/resources
|
| 26 |
|
| 27 |
# Create non-root user
|
|
|
|
| 9 |
# Clone the Coral Server repository
|
| 10 |
RUN git clone https://github.com/Coral-Protocol/coral-server.git .
|
| 11 |
|
| 12 |
+
# Build the application JAR (skip tests)
|
| 13 |
+
RUN ./gradlew bootJar -x test --no-daemon || ./gradlew shadowJar -x test --no-daemon || ./gradlew jar -x test --no-daemon
|
| 14 |
|
| 15 |
# Stage 2: Runtime
|
| 16 |
FROM eclipse-temurin:17-jre-alpine
|
|
|
|
| 20 |
|
| 21 |
WORKDIR /app
|
| 22 |
|
| 23 |
+
# Copy the built JAR from builder stage
|
| 24 |
+
# Try different possible locations where the JAR might be
|
| 25 |
COPY --from=builder /app/build/libs/*.jar coral-server.jar
|
| 26 |
+
|
| 27 |
+
# Copy resources if needed
|
| 28 |
COPY --from=builder /app/src/main/resources /app/resources
|
| 29 |
|
| 30 |
# Create non-root user
|