Skip to content

Commit fa017a9

Browse files
authored
Merge pull request #148 from rostilos/1.5.1-rc
feat: Update healthcheck URLs to use 127.0.0.1 and enhance Dockerfile…
2 parents e7975b5 + 175f5e0 commit fa017a9

6 files changed

Lines changed: 29 additions & 15 deletions

File tree

deployment/docker-compose.prod.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ services:
9696
- ./config/java-shared/github-private-key/github-app-private-key.pem:/app/config/github-app-private-key.pem
9797
- ./config/java-shared/newrelic-web-server.yml:/usr/local/newrelic/newrelic.yml:ro
9898
healthcheck:
99-
test: ["CMD", "curl", "-f", "http://localhost:8081/actuator/health"]
99+
test: ["CMD", "curl", "-f", "http://127.0.0.1:8081/actuator/health"]
100100
interval: 30s
101101
timeout: 10s
102102
retries: 5
@@ -143,7 +143,7 @@ services:
143143
- ./config/java-shared/github-private-key/github-app-private-key.pem:/app/config/github-app-private-key.pem
144144
- ./config/java-shared/newrelic-pipeline-agent.yml:/usr/local/newrelic/newrelic.yml:ro
145145
healthcheck:
146-
test: ["CMD", "curl", "-f", "http://localhost:8082/actuator/health"]
146+
test: ["CMD", "curl", "-f", "http://127.0.0.1:8082/actuator/health"]
147147
interval: 30s
148148
timeout: 10s
149149
retries: 5

deployment/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ services:
9696
- ./config/java-shared/application.properties:/app/config/application.properties
9797
- ./config/java-shared/github-private-key/github-app-private-key.pem:/app/config/github-app-private-key.pem
9898
healthcheck:
99-
test: ["CMD", "curl", "-f", "http://localhost:8081/actuator/health"]
99+
test: ["CMD", "curl", "-f", "http://127.0.0.1:8081/actuator/health"]
100100
interval: 30s
101101
timeout: 10s
102102
retries: 5
@@ -145,7 +145,7 @@ services:
145145
- ./config/java-shared/application.properties:/app/config/application.properties
146146
- ./config/java-shared/github-private-key/github-app-private-key.pem:/app/config/github-app-private-key.pem
147147
healthcheck:
148-
test: ["CMD", "curl", "-f", "http://localhost:8082/actuator/health"]
148+
test: ["CMD", "curl", "-f", "http://127.0.0.1:8082/actuator/health"]
149149
interval: 30s
150150
timeout: 10s
151151
retries: 5
@@ -206,7 +206,7 @@ services:
206206
- rag_logs:/app/logs
207207
- ./config/rag-pipeline/.env:/app/.env
208208
healthcheck:
209-
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
209+
test: ["CMD", "curl", "-f", "http://127.0.0.1:8001/health"]
210210
interval: 30s
211211
timeout: 10s
212212
retries: 5
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
FROM eclipse-temurin:17-jre-alpine
22

3-
RUN apk add --no-cache curl && \
3+
RUN apk add --no-cache curl su-exec && \
44
addgroup -g 1001 -S appgroup && adduser -u 1001 -S appuser -G appgroup && \
55
mkdir -p /app/logs && chown -R appuser:appgroup /app
66

77
WORKDIR /app
88

99
COPY --chown=appuser:appgroup ./target/codecrow-pipeline-agent-1.0.jar app.jar
1010

11-
USER appuser
11+
# Entrypoint: fix volume ownership, then drop to appuser
12+
RUN printf '#!/bin/sh\nchown -R appuser:appgroup /app/logs 2>/dev/null || true\nexec su-exec appuser "$@"\n' > /entrypoint.sh && chmod +x /entrypoint.sh
1213

1314
EXPOSE 8082
1415

16+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
17+
CMD curl -f http://127.0.0.1:8082/actuator/health || exit 1
18+
1519
ENV JAVA_OPTS="-Xms512m -Xmx1g -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+UseStringDeduplication"
1620

21+
ENTRYPOINT ["/entrypoint.sh"]
1722
CMD ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]

java-ecosystem/services/pipeline-agent/Dockerfile.observable

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM eclipse-temurin:17-jre-alpine
22

3-
RUN apk add --no-cache curl unzip && \
3+
RUN apk add --no-cache curl unzip su-exec && \
44
addgroup -g 1001 -S appgroup && adduser -u 1001 -S appuser -G appgroup && \
55
mkdir -p /app/logs && chown -R appuser:appgroup /app
66

@@ -18,11 +18,16 @@ RUN mkdir -p /usr/local/newrelic && \
1818
chmod 644 /usr/local/newrelic/newrelic.jar && \
1919
chown -R appuser:appgroup /usr/local/newrelic
2020

21-
USER appuser
21+
# Entrypoint: fix volume ownership, then drop to appuser
22+
RUN printf '#!/bin/sh\nchown -R appuser:appgroup /app/logs 2>/dev/null || true\nexec su-exec appuser "$@"\n' > /entrypoint.sh && chmod +x /entrypoint.sh
2223

2324
EXPOSE 8082
2425

26+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
27+
CMD curl -f http://127.0.0.1:8082/actuator/health || exit 1
28+
2529
ENV NEW_RELIC_LOG_FILE_NAME=STDOUT
2630
ENV JAVA_OPTS="-Xms512m -Xmx1g -javaagent:/usr/local/newrelic/newrelic.jar -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+UseStringDeduplication"
2731

32+
ENTRYPOINT ["/entrypoint.sh"]
2833
CMD ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
FROM eclipse-temurin:17-jre-alpine
22

3-
RUN apk add --no-cache curl && \
3+
RUN apk add --no-cache curl su-exec && \
44
addgroup -g 1001 -S appgroup && adduser -u 1001 -S appuser -G appgroup && \
55
mkdir -p /app/logs && chown -R appuser:appgroup /app
66

77
WORKDIR /app
88

99
COPY --chown=appuser:appgroup ./target/codecrow-web-server-1.0-exec.jar app.jar
1010

11-
USER appuser
11+
# Entrypoint: fix volume ownership, then drop to appuser
12+
RUN printf '#!/bin/sh\nchown -R appuser:appgroup /app/logs 2>/dev/null || true\nexec su-exec appuser "$@"\n' > /entrypoint.sh && chmod +x /entrypoint.sh
1213

1314
EXPOSE 8081
1415

1516
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
16-
CMD curl -f http://localhost:8081/actuator/health || exit 1
17+
CMD curl -f http://127.0.0.1:8081/actuator/health || exit 1
1718

1819
ENV JAVA_OPTS="-Xms512m -Xmx1g -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+UseStringDeduplication"
1920

21+
ENTRYPOINT ["/entrypoint.sh"]
2022
CMD ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]

java-ecosystem/services/web-server/Dockerfile.observable

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM eclipse-temurin:17-jre-alpine
22

3-
RUN apk add --no-cache curl unzip && \
3+
RUN apk add --no-cache curl unzip su-exec && \
44
addgroup -g 1001 -S appgroup && adduser -u 1001 -S appuser -G appgroup && \
55
mkdir -p /app/logs && chown -R appuser:appgroup /app
66

@@ -18,14 +18,16 @@ RUN mkdir -p /usr/local/newrelic && \
1818
chmod 644 /usr/local/newrelic/newrelic.jar && \
1919
chown -R appuser:appgroup /usr/local/newrelic
2020

21-
USER appuser
21+
# Entrypoint: fix volume ownership, then drop to appuser
22+
RUN printf '#!/bin/sh\nchown -R appuser:appgroup /app/logs 2>/dev/null || true\nexec su-exec appuser "$@"\n' > /entrypoint.sh && chmod +x /entrypoint.sh
2223

2324
EXPOSE 8081
2425

2526
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
26-
CMD curl -f http://localhost:8081/actuator/health || exit 1
27+
CMD curl -f http://127.0.0.1:8081/actuator/health || exit 1
2728

2829
ENV NEW_RELIC_LOG_FILE_NAME=STDOUT
2930
ENV JAVA_OPTS="-Xms512m -Xmx1g -javaagent:/usr/local/newrelic/newrelic.jar -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+UseStringDeduplication"
3031

32+
ENTRYPOINT ["/entrypoint.sh"]
3133
CMD ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]

0 commit comments

Comments
 (0)