-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 847 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 847 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
# Stage 1: Build
FROM gradle:8.10-jdk21 AS builder
WORKDIR /app
COPY build.gradle.kts settings.gradle.kts gradle.properties ./
COPY gradle ./gradle
RUN gradle dependencies --no-daemon || true
COPY src ./src
RUN gradle shadowJar --no-daemon
# Stage 2: Runtime
FROM eclipse-temurin:21-jre-alpine
RUN addgroup -S dashboard && adduser -S dashboard -G dashboard
WORKDIR /app
COPY --from=builder /app/build/libs/token-dashboard-*-all.jar app.jar
RUN mkdir -p /data && chown dashboard:dashboard /data
VOLUME /data
USER dashboard
ENV TD_HOST=0.0.0.0
ENV TD_PORT=8080
ENV TD_OTLP_PORT=4317
ENV TD_DB_PATH=/data/token-dashboard.db
EXPOSE 8080 4317
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/api/v1/health || exit 1
ENTRYPOINT ["java", "-jar", "app.jar"]