diff --git a/packages/graphql-mesh/Dockerfile b/packages/graphql-mesh/Dockerfile index 9898075..4dcfbe5 100644 --- a/packages/graphql-mesh/Dockerfile +++ b/packages/graphql-mesh/Dockerfile @@ -1,4 +1,5 @@ -FROM node:18-alpine AS builder +# BUILD +FROM node:18-slim AS builder WORKDIR /build @@ -7,12 +8,12 @@ ADD local-pkg ./local-pkg ADD patches ./patches ADD .npmrc ./ RUN npm ci --omit=dev --omit=optional --omit=peer -RUN rm -rf node_modules/uWebSockets.js/*.node RUN cd node_modules/typescript/lib && rm -rf cs de es fr it ja ko pl pt-br ru tr zh-cn zh-tw COPY . ./ RUN rm ./config.yaml -FROM node:18-alpine AS runner +# RUN +FROM node:18-slim AS runner LABEL org.opencontainers.image.description="GraphQL Mesh Gateway" LABEL org.opencontainers.image.vendor="Bouygues Telecom" @@ -26,6 +27,7 @@ ENV ENDPOINT=$ENDPOINT ENV NODE_TLS_REJECT_UNAUTHORIZED=0 ENV TS_NODE_FILES=true ENV TS_NODE_TRANSPILE_ONLY=true +ENV UWS_HTTP_MAX_HEADERS_SIZE=8000 VOLUME /app/plugins VOLUME /app/resolvers diff --git a/packages/graphql-mesh/package.json b/packages/graphql-mesh/package.json index 04a6a48..22150d2 100644 --- a/packages/graphql-mesh/package.json +++ b/packages/graphql-mesh/package.json @@ -4,7 +4,7 @@ "build": "npm run downloadswaggers && mesh build", "downloadswaggers": "NODE_TLS_REJECT_UNAUTHORIZED='0' sucrase-node ./scripts/download-sources.ts", "postinstall": "patch-package", - "serve": "npm run build && sucrase-node serve.ts", + "serve": "npm run build && mesh start", "start": "npm run downloadswaggers && mesh dev", "test": "vitest" }, diff --git a/packages/graphql-mesh/serve.ts b/packages/graphql-mesh/serve.ts deleted file mode 100644 index 442a14d..0000000 --- a/packages/graphql-mesh/serve.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { createServer } from 'node:http' -import { createBuiltMeshHTTPHandler } from './.mesh' -import { getConfig } from './utils/parseYamlConfig' -const config = getConfig() - -const PORT = config.serve?.port ?? 4000 -const HOSTNAME = config.serve?.hostname ?? 'http://0.0.0.0' - -const server = createServer(createBuiltMeshHTTPHandler()) -console.log(`🚀 Server ready at ${HOSTNAME}:${PORT}/graphql`) -server.listen(PORT)