暂存提交
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
FROM eclipse-temurin:17-jre-alpine
|
||||
|
||||
RUN apk add --no-cache curl \
|
||||
&& addgroup -S app \
|
||||
&& adduser -S -G app -u 10001 app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ARG JAR_FILE
|
||||
COPY --chown=app:app ${JAR_FILE} /app/app.jar
|
||||
|
||||
USER app
|
||||
|
||||
ENV JAVA_OPTS="-XX:MaxRAMPercentage=75.0 -XX:+ExitOnOutOfMemoryError -Dfile.encoding=UTF-8" \
|
||||
SERVER_PORT=8080
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
|
||||
CMD curl -fsS "http://127.0.0.1:${SERVER_PORT}/actuator/health" || exit 1
|
||||
|
||||
ENTRYPOINT ["sh", "-c", "exec java $JAVA_OPTS -jar /app/app.jar"]
|
||||
Reference in New Issue
Block a user