🌳
pt0/deployF/servicesF/ensGatewayF/eptEnsGatewayAI.mts
7import { type secretNameType } from '../../../serverF/secretsF/getPlainSecAI.mts'
10const ensGatewayName = 'ensgateway', svcPort = 3000
12export const eptEnsGateway = async ({hostname, importMetaUrl, ipfsGatewayOrigin, name = ensGatewayName, alchemySecretName = 'alchemy-api-ensgateway', ...klusterCfg}: {hostname: string, importMetaUrl: string, ipfsGatewayOrigin: string, name?: string, alchemySecretName?: string, [k: string]: any}) => {
13 const ethDomainSuffix = hostname.replace('*', '')
14 const epCfg = {importMetaUrl, kube_extHostname: hostname, name, svcPortNo: svcPort}
15 if (importMetaUrl && !isDirectlyRun(importMetaUrl)) return epCfg
17 const action = getAction()
18 appCfgCtx.enterWith({...klusterCfg, action, name})
20 nextContCtx.enterWith({
21 command: ['sh', '-c', 'npm install --omit=dev && node server.mts'],
22 ports: [{containerPort: svcPort}],
23 env: [
24 {name: 'PORT', value: String(svcPort)},
25 {name: 'ETH_DOMAIN_SUFFIX', value: ethDomainSuffix},
26 {name: 'IPFS_GATEWAY_ORIGIN', value: ipfsGatewayOrigin},
27 ],
28 envFrom: [{secretRef: {name: alchemySecretName}}],
29 })
31 const modVolsFnc = async ({resources}: {resources: any[]}) => {
32 resources.push(secretEnvTemplate({name: alchemySecretName as secretNameType, kubeName: alchemySecretName}))
33 }
34 ptKubeCtx.enterWith({modVolsFnc})
36 const copyPathsA = [
37 ptAnchorPath('pt0/deployF/servicesF/ensGatewayF/server.mts'),
38 ptAnchorPath('pt0/deployF/servicesF/ensGatewayF/package.json'),
39 ]
43 importMetaUrl: import.meta.url,
44 name,
45 kube_extHostname: hostname,
46 svcPortNo: svcPort,
47 copyPathsA,
48 })