|
1 | 1 | # Unified Dockerfile for NCC-bundled TypeScript node services |
2 | | -# Used by: rebalancer, warp-monitor |
| 2 | +# Used by: rebalancer, warp-monitor, ccip-server |
3 | 3 | # |
4 | 4 | # Build args (passed from docker-bake.hcl): |
5 | 5 | # SERVICE_DIR - Directory name under typescript/ (e.g., "rebalancer") |
6 | 6 | # SERVICE_PACKAGE - Package name for turbo filter (e.g., "@hyperlane-xyz/rebalancer") |
| 7 | +# SERVICE_PORT - Optional HTTP port (default: none, only metrics on 9090) |
7 | 8 |
|
8 | 9 | FROM node:24-slim AS builder |
9 | 10 |
|
@@ -54,6 +55,13 @@ COPY solidity/package.json ./solidity/ |
54 | 55 | COPY solhint-plugin/package.json ./solhint-plugin/ |
55 | 56 | COPY starknet/package.json ./starknet/ |
56 | 57 |
|
| 58 | +# Copy prisma schema if present (needed for postinstall prisma generate in ccip-server) |
| 59 | +RUN --mount=type=bind,source=typescript/${SERVICE_DIR},target=/tmp/service-src \ |
| 60 | + if [ -d /tmp/service-src/prisma ]; then \ |
| 61 | + mkdir -p typescript/${SERVICE_DIR} && \ |
| 62 | + cp -r /tmp/service-src/prisma typescript/${SERVICE_DIR}/prisma; \ |
| 63 | + fi |
| 64 | + |
57 | 65 | RUN pnpm install --frozen-lockfile |
58 | 66 |
|
59 | 67 | # Copy source files |
@@ -116,11 +124,13 @@ RUN GCP_LOGGER_VERSION=$(grep "pino-logging-gcp-config" /tmp/pnpm-workspace.yaml |
116 | 124 |
|
117 | 125 | # Environment variables |
118 | 126 | ARG SERVICE_VERSION=dev |
| 127 | +ARG SERVICE_PORT |
119 | 128 | ENV NODE_ENV=production |
120 | 129 | ENV LOG_LEVEL=info |
121 | 130 | ENV SERVICE_VERSION=${SERVICE_VERSION} |
| 131 | +ENV SERVER_PORT=${SERVICE_PORT} |
122 | 132 |
|
123 | | -# Expose metrics port |
| 133 | +# Expose metrics port; service port published at runtime with -p if needed |
124 | 134 | EXPOSE 9090 |
125 | 135 |
|
126 | 136 | # Run the service from the bundle |
|
0 commit comments