-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 813 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 813 Bytes
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
30
31
32
33
# Use OpenJDK 17 as base image
FROM openjdk:17-jdk-slim
# Set working directory
WORKDIR /app
# Copy Gradle wrapper and build files first (for better layer caching)
COPY gradlew .
COPY gradle gradle
COPY build.gradle.kts .
COPY settings.gradle.kts .
# Make gradlew executable
RUN chmod +x ./gradlew
# Download dependencies (this layer will be cached unless build.gradle.kts changes)
RUN ./gradlew dependencies --no-daemon
# Copy source code
COPY src ./src
# Build the application
RUN ./gradlew clean build -x test --no-daemon
# Expose the port your app runs on
EXPOSE 8065
# Add health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8065/health || exit 1
# Run the application
CMD ["java", "-jar", "build/libs/wallet-app-0.0.1-SNAPSHOT.jar"]