Spaces:
Build error
Build error
File size: 692 Bytes
045957f 576352b c4237eb 045957f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
FROM openjdk:21-jdk-slim
WORKDIR /app
# Install required packages
RUN apt-get update && apt-get install -y \
curl \
wget \
&& rm -rf /var/lib/apt/lists/*
# Copy application files
COPY . .
# Make gradlew executable and build application (if build.gradle.kts or build.gradle exists)
RUN if [ -f "build.gradle.kts" ] || [ -f "build.gradle" ]; then \
chmod +x ./gradlew && \
./gradlew build -x test; \
fi
# Expose port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8080/actuator/health || exit 1
# Run application
CMD ["java", "-jar", "build/libs/da-policyengine.jar"]
|