LibreChat/packages/channel-gateway/Dockerfile
Marco Beretta effcec615d
🐳 fix: Qualify Docker Hub Image Names in Compose Files and Dockerfiles (#17950)
* fix: Qualify Docker Hub Image Names in Compose Files and Dockerfiles

Podman has no default registry, so a short image name such as mongo:8.0.20
or pgvector/pgvector:0.8.0-pg15-trixie fails with "short-name did not
resolve to an alias" unless the host configures unqualified-search
registries. Name docker.io on every third-party image in the compose files,
the override example and the Dockerfiles, using docker.io/library/ for
official images. Tags and digests are unchanged.

scripts/images.test.mjs fails on any image a compose file or Dockerfile
pulls without a registry host, and Static Checks runs it when one of those
files changes.

* test: Harden the image name scanner for indented comments and variable defaults

Commented image lines are matched at any indentation, a variable with an empty default or more than one interpolation is not guessed, and a Dockerfile FROM with a default is judged by that default, as in compose files.

* fix: Qualify the Channel Gateway and Mongo Replica Images

The channel compose stack landed on dev with short names, which the image name test now rejects.
2026-11-14 21:47:59 +01:00

35 lines
1.7 KiB
Docker

FROM docker.io/library/node:24.22.3-alpine AS build
ENV SCARF_ANALYTICS=false HUSKY=0
WORKDIR /build
COPY package.json package-lock.json ./
COPY api/package.json ./api/package.json
COPY client/package.json ./client/package.json
COPY packages/api/package.json ./packages/api/package.json
COPY packages/client/package.json ./packages/client/package.json
COPY packages/chat/package.json ./packages/chat/package.json
COPY packages/data-schemas/package.json ./packages/data-schemas/package.json
COPY packages/data-provider/package.json ./packages/data-provider/package.json
COPY packages/channel-gateway/package.json ./packages/channel-gateway/package.json
COPY vendor/code ./vendor/code
RUN npm ci --ignore-scripts --no-audit --workspace @librechat/channel-gateway --workspace librechat-data-provider --include-workspace-root=false
COPY packages/data-provider ./packages/data-provider
COPY packages/channel-gateway ./packages/channel-gateway
COPY scripts/typecheck.mts ./scripts/typecheck.mts
RUN npm run build --workspace librechat-data-provider \
&& npm run typecheck --workspace @librechat/channel-gateway \
&& npm run build --workspace @librechat/channel-gateway
FROM docker.io/library/node:24.22.3-alpine AS runtime
ENV NODE_ENV=production PORT=8080 LISTEN_HOST=0.0.0.0
WORKDIR /app
COPY --from=build --chown=node:node /build/packages/channel-gateway/dist/main.cjs ./main.cjs
COPY --chown=node:node LICENSE ./LICENSE
USER node
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD node -e "fetch('http://127.0.0.1:'+process.env.PORT+'/healthz',{signal:AbortSignal.timeout(4000)}).then(r=>{if(!r.ok)process.exitCode=1}).catch(()=>{process.exitCode=1})"
CMD ["node", "main.cjs"]