Revert "shrink docker image / esbuildify (#319)"
This reverts commit 4227c6b546.
This commit is contained in:
@@ -1,4 +0,0 @@
|
|||||||
*/**/node_modules/
|
|
||||||
*/**/lib
|
|
||||||
.husky/
|
|
||||||
node_modules/
|
|
||||||
51
Dockerfile
51
Dockerfile
@@ -1,36 +1,19 @@
|
|||||||
FROM node:20.18.1 AS builder
|
FROM public.ecr.aws/bitnami/node:20.18.1
|
||||||
|
RUN apt-get install git
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy package files first to leverage cache
|
|
||||||
COPY package.json yarn.lock ./
|
|
||||||
COPY drift-common/protocol/sdk/package.json ./drift-common/protocol/sdk/
|
|
||||||
COPY drift-common/common-ts/package.json ./drift-common/common-ts/
|
|
||||||
|
|
||||||
RUN npm install -g bun typescript husky
|
|
||||||
|
|
||||||
WORKDIR /app/drift-common/protocol/sdk
|
|
||||||
COPY drift-common/protocol/sdk/ .
|
|
||||||
RUN bun install --production && bun run build
|
|
||||||
|
|
||||||
WORKDIR /app/drift-common/common-ts
|
|
||||||
COPY drift-common/common-ts/ .
|
|
||||||
RUN bun install --production && bun run build
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
COPY . .
|
|
||||||
# no '--production' for esbuild
|
|
||||||
RUN bun install && bun esbuild.config.js
|
|
||||||
|
|
||||||
FROM node:20.18.1-alpine
|
|
||||||
# 'bigint-buffer' native lib for performance
|
|
||||||
# @triton-one/yellowstone-grpc so .wasm lib included
|
|
||||||
RUN apk add python3 make g++ --virtual .build &&\
|
|
||||||
npm install -C /lib bigint-buffer @triton-one/yellowstone-grpc &&\
|
|
||||||
apk del .build
|
|
||||||
COPY --from=builder /app/lib/ ./lib/
|
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
EXPOSE 9464
|
RUN npm install -g typescript
|
||||||
|
|
||||||
CMD ["node", "./lib/index.js"]
|
WORKDIR /app
|
||||||
|
COPY drift-common /app/drift-common
|
||||||
|
COPY . .
|
||||||
|
WORKDIR /app/drift-common/protocol/sdk
|
||||||
|
RUN yarn
|
||||||
|
RUN yarn build
|
||||||
|
WORKDIR /app/drift-common/common-ts
|
||||||
|
RUN yarn
|
||||||
|
RUN yarn build
|
||||||
|
WORKDIR /app
|
||||||
|
RUN yarn
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
EXPOSE 9464
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
const esbuild = require('esbuild');
|
|
||||||
const glob = require('tiny-glob');
|
|
||||||
|
|
||||||
const commonConfig = {
|
|
||||||
bundle: true,
|
|
||||||
platform: 'node',
|
|
||||||
target: 'node20',
|
|
||||||
sourcemap: false,
|
|
||||||
// minify: true, makes messy debug/error output
|
|
||||||
treeShaking: true,
|
|
||||||
legalComments: 'none',
|
|
||||||
mainFields: ['module', 'main'],
|
|
||||||
metafile: true,
|
|
||||||
format: 'cjs',
|
|
||||||
external: [
|
|
||||||
'bigint-buffer',
|
|
||||||
'@triton-one/yellowstone-grpc'
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
let entryPoints = await glob("./src/*.ts", { filesOnly: true });
|
|
||||||
await esbuild.build({
|
|
||||||
...commonConfig,
|
|
||||||
entryPoints,
|
|
||||||
outdir: 'lib',
|
|
||||||
});
|
|
||||||
})().catch(() => process.exit(1));
|
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coral-xyz/anchor": "^0.29.0",
|
"@coral-xyz/anchor": "^0.29.0",
|
||||||
"@drift-labs/sdk": "file:./drift-common/protocol/sdk",
|
|
||||||
"@drift/common": "file:./drift-common/common-ts",
|
"@drift/common": "file:./drift-common/common-ts",
|
||||||
|
"@drift-labs/sdk": "file:./drift-common/protocol/sdk",
|
||||||
"@opentelemetry/api": "^1.1.0",
|
"@opentelemetry/api": "^1.1.0",
|
||||||
"@opentelemetry/auto-instrumentations-node": "^0.31.1",
|
"@opentelemetry/auto-instrumentations-node": "^0.31.1",
|
||||||
"@opentelemetry/exporter-prometheus": "^0.31.0",
|
"@opentelemetry/exporter-prometheus": "^0.31.0",
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
"response-time": "^2.3.2",
|
"response-time": "^2.3.2",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"socket.io-redis": "^6.1.1",
|
"socket.io-redis": "^6.1.1",
|
||||||
|
"typescript": "4.5.4",
|
||||||
"undici": "^6.16.1",
|
"undici": "^6.16.1",
|
||||||
"winston": "^3.8.1",
|
"winston": "^3.8.1",
|
||||||
"ws": "^8.14.2"
|
"ws": "^8.14.2"
|
||||||
@@ -41,14 +42,12 @@
|
|||||||
"@types/k6": "^0.45.0",
|
"@types/k6": "^0.45.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.28.0",
|
"@typescript-eslint/eslint-plugin": "^4.28.0",
|
||||||
"@typescript-eslint/parser": "^4.28.0",
|
"@typescript-eslint/parser": "^4.28.0",
|
||||||
"esbuild": "^0.24.0",
|
|
||||||
"eslint": "^7.29.0",
|
"eslint": "^7.29.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-prettier": "^3.4.0",
|
"eslint-plugin-prettier": "^3.4.0",
|
||||||
"husky": "^7.0.4",
|
"husky": "^7.0.4",
|
||||||
"k6": "^0.0.0",
|
"k6": "^0.0.0",
|
||||||
"prettier": "^2.4.1",
|
"prettier": "^2.4.1",
|
||||||
"tiny-glob": "^0.2.9",
|
|
||||||
"ts-node": "^10.9.1"
|
"ts-node": "^10.9.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user