diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4425beafb64442a67d3e78aedc09f2f3ffcb8072 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# global node image +FROM node:20-alpine AS base +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable +COPY . /app +WORKDIR /app + +# build deps +FROM base as deps +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile + +# datapod image +FROM base +COPY --from=deps /app/node_modules /app/node_modules +CMD ["npx", "tsx", "src/scripts/hello.ts"] + + +# TODO build image only for indexer without app +# TODO really build for node and not use tsx (is it necessary) + +# build and run for test +# docker buildx build . -t test-datapod +# docker run --rm -it test-datapod diff --git a/src/scripts/hello.ts b/src/scripts/hello.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e2c8770c1329cdfe108eae4e4f22ddf84d516d9 --- /dev/null +++ b/src/scripts/hello.ts @@ -0,0 +1 @@ +console.log('Hello World!')