-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 782 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (22 loc) · 782 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
# Runtime only
FROM eclipse-temurin:25-jre-alpine
# Add non-root user
RUN addgroup -g 1000 dutypark && \
adduser -D -s /bin/sh -u 1000 -G dutypark dutypark
# Set working directory
WORKDIR /app
# Create logs directory
RUN mkdir -p /dutypark/logs && chown dutypark:dutypark /dutypark/logs
# Copy the built jar from local build
COPY build/libs/*.jar app.jar
# Change ownership
RUN chown dutypark:dutypark /app/app.jar
# Switch to non-root user
USER dutypark
# Expose port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1
# Run the application
ENTRYPOINT ["java", "-jar", "-Djava.security.egd=file:/dev/./urandom", "/app/app.jar"]