Skip to content

Commit 0d321ea

Browse files
motscfleon
andauthored
update Docker images for Docker Scout Score improvements (#1680)
Co-authored-by: Himanshu Kapoor <himanshu.kapoor@clickhouse.com>
1 parent 22f882d commit 0d321ea

6 files changed

Lines changed: 80 additions & 0 deletions

File tree

‎docker/hostmetrics/Dockerfile‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,22 @@ FROM otel/opentelemetry-collector-contrib:0.90.0 AS base
55
## dev #############################################################################################
66
FROM base as dev
77

8+
LABEL org.opencontainers.image.vendor="HyperDX" \
9+
org.opencontainers.image.title="HyperDX Host Metrics (Dev)" \
10+
org.opencontainers.image.description="Host metrics collector for HyperDX development" \
11+
org.opencontainers.image.source="https://github.com/hyperdx/hyperdx" \
12+
org.opencontainers.image.licenses="MIT"
13+
814
COPY ./config.dev.yaml /etc/otelcol-contrib/config.yaml
915

1016

1117
## prod #############################################################################################
1218
FROM base as prod
1319

20+
LABEL org.opencontainers.image.vendor="HyperDX" \
21+
org.opencontainers.image.title="HyperDX Host Metrics" \
22+
org.opencontainers.image.description="Host metrics collector for HyperDX observability platform" \
23+
org.opencontainers.image.source="https://github.com/hyperdx/hyperdx" \
24+
org.opencontainers.image.licenses="MIT"
25+
1426
COPY ./config.dev.yaml /etc/otelcol-contrib/config.yaml

‎docker/hyperdx/Dockerfile‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ RUN rm -rf node_modules && yarn workspaces focus @hyperdx/api --production
5656
# prod ############################################################################################
5757
FROM node:${NODE_VERSION}-alpine AS prod
5858

59+
LABEL org.opencontainers.image.vendor="HyperDX" \
60+
org.opencontainers.image.title="HyperDX Production" \
61+
org.opencontainers.image.description="HyperDX production image with API and App services" \
62+
org.opencontainers.image.source="https://github.com/hyperdx/hyperdx" \
63+
org.opencontainers.image.licenses="MIT"
64+
5965
ARG CODE_VERSION
6066

6167
ENV CODE_VERSION=$CODE_VERSION
@@ -78,6 +84,10 @@ COPY --chown=node:node --from=builder /app/packages/app/public ./packages/app/pa
7884

7985
# Set up start script
8086
COPY --chown=node:node --from=hyperdx ./entry.prod.sh /etc/local/entry.sh
87+
88+
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
89+
CMD node -e "require('http').get('http://localhost:8000/health',r=>r.statusCode===200?process.exit(0):process.exit(1)).on('error',()=>process.exit(1))"
90+
8191
ENTRYPOINT ["sh", "/etc/local/entry.sh"]
8292

8393
# all-in-one base ############################################################################################
@@ -142,11 +152,33 @@ EXPOSE 8080 4317 4318 13133 8123 9000
142152

143153
# all-in-one no auth ############################################################################################
144154
FROM all-in-one-base AS all-in-one-noauth
155+
156+
LABEL org.opencontainers.image.vendor="HyperDX" \
157+
org.opencontainers.image.title="HyperDX All-in-One (No Auth)" \
158+
org.opencontainers.image.description="HyperDX all-in-one image with ClickHouse, MongoDB, and OTel Collector (no authentication)" \
159+
org.opencontainers.image.source="https://github.com/hyperdx/hyperdx" \
160+
org.opencontainers.image.licenses="MIT"
161+
145162
COPY --from=hyperdx ./entry.local.noauth.sh /etc/local/entry.sh
163+
164+
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
165+
CMD curl -f http://localhost:8080/api/health || exit 1
166+
146167
ENTRYPOINT ["sh", "/etc/local/entry.sh"]
147168

148169
# all-in-one with auth ############################################################################################
149170
FROM all-in-one-base AS all-in-one-auth
171+
172+
LABEL org.opencontainers.image.vendor="HyperDX" \
173+
org.opencontainers.image.title="HyperDX All-in-One (With Auth)" \
174+
org.opencontainers.image.description="HyperDX all-in-one image with ClickHouse, MongoDB, and OTel Collector (with authentication)" \
175+
org.opencontainers.image.source="https://github.com/hyperdx/hyperdx" \
176+
org.opencontainers.image.licenses="MIT"
177+
150178
COPY --from=hyperdx ./entry.local.auth.sh /etc/local/entry.sh
179+
180+
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
181+
CMD curl -f http://localhost:8080/api/health || exit 1
182+
151183
ENTRYPOINT ["sh", "/etc/local/entry.sh"]
152184

‎docker/otel-collector/Dockerfile‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ COPY --chmod=755 ./log-tailer.sh /log-tailer.sh
3131
## dev ##############################################################################################
3232
FROM base AS dev
3333

34+
LABEL org.opencontainers.image.vendor="HyperDX" \
35+
org.opencontainers.image.title="HyperDX OTel Collector (Dev)" \
36+
org.opencontainers.image.description="OpenTelemetry Collector for HyperDX development" \
37+
org.opencontainers.image.source="https://github.com/hyperdx/hyperdx" \
38+
org.opencontainers.image.licenses="MIT"
39+
3440
COPY --chown=10001:10001 ./config.yaml /etc/otelcol-contrib/config.yaml
3541
COPY --chown=10001:10001 ./config.standalone.yaml /etc/otelcol-contrib/standalone-config.yaml
3642
COPY --chown=10001:10001 ./supervisor_docker.yaml.tmpl /etc/otel/supervisor.yaml.tmpl
@@ -42,6 +48,12 @@ ENTRYPOINT ["/entrypoint.sh", "/opampsupervisor"]
4248
## prod #############################################################################################
4349
FROM base AS prod
4450

51+
LABEL org.opencontainers.image.vendor="HyperDX" \
52+
org.opencontainers.image.title="HyperDX OTel Collector" \
53+
org.opencontainers.image.description="OpenTelemetry Collector for HyperDX observability platform" \
54+
org.opencontainers.image.source="https://github.com/hyperdx/hyperdx" \
55+
org.opencontainers.image.licenses="MIT"
56+
4557
COPY --chown=10001:10001 ./config.yaml /etc/otelcol-contrib/config.yaml
4658
COPY --chown=10001:10001 ./config.standalone.yaml /etc/otelcol-contrib/standalone-config.yaml
4759
COPY --chown=10001:10001 ./supervisor_docker.yaml.tmpl /etc/otel/supervisor.yaml.tmpl

‎packages/api/Dockerfile‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ RUN rm -rf node_modules && yarn workspaces focus @hyperdx/api --production
3434

3535
FROM node:22.16.0-alpine AS prod
3636

37+
LABEL org.opencontainers.image.vendor="HyperDX" \
38+
org.opencontainers.image.title="HyperDX API" \
39+
org.opencontainers.image.description="HyperDX API service for observability platform" \
40+
org.opencontainers.image.source="https://github.com/hyperdx/hyperdx" \
41+
org.opencontainers.image.licenses="MIT"
42+
3743
ARG CODE_VERSION
3844

3945
ENV CODE_VERSION=$CODE_VERSION
@@ -53,4 +59,7 @@ COPY --chown=node:node --from=builder /app/node_modules ./node_modules
5359
COPY --chown=node:node --from=builder /app/packages/api/build ./packages/api/build
5460
COPY --chown=node:node --from=builder /app/packages/common-utils/dist ./packages/common-utils/dist
5561

62+
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
63+
CMD node -e "require('http').get('http://localhost:'+(process.env.PORT||8000)+'/health',r=>r.statusCode===200?process.exit(0):process.exit(1)).on('error',()=>process.exit(1))"
64+
5665
ENTRYPOINT ["node", "-r", "@hyperdx/node-opentelemetry/build/src/tracing", "./packages/api/build/index.js"]

‎packages/app/Dockerfile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ RUN rm -rf node_modules && yarn workspaces focus @hyperdx/app --production
4444

4545
## prod ############################################################################################
4646
FROM node:22.16.0-alpine AS prod
47+
48+
LABEL org.opencontainers.image.vendor="HyperDX" \
49+
org.opencontainers.image.title="HyperDX App" \
50+
org.opencontainers.image.description="HyperDX frontend application for observability platform" \
51+
org.opencontainers.image.source="https://github.com/hyperdx/hyperdx" \
52+
org.opencontainers.image.licenses="MIT"
53+
4754
WORKDIR /app
4855

4956
ENV NODE_ENV production
@@ -71,4 +78,7 @@ EXPOSE ${PORT}
7178
# Uncomment the following line in case you want to disable telemetry.
7279
ENV NEXT_TELEMETRY_DISABLED 1
7380

81+
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
82+
CMD node -e "require('http').get('http://localhost:'+(process.env.PORT||8080)+'/api/health',r=>r.statusCode===200?process.exit(0):process.exit(1)).on('error',()=>process.exit(1))"
83+
7484
CMD ["sh", "-c", "node_modules/.bin/next start -p ${PORT}"]

‎packages/app/pages/api/health.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { NextApiRequest, NextApiResponse } from 'next';
2+
3+
export default function handler(_req: NextApiRequest, res: NextApiResponse) {
4+
res.status(200).json({ status: 'ok' });
5+
}

0 commit comments

Comments
 (0)