From acb5259c320f438b96dc956cbf66a23f815ed359 Mon Sep 17 00:00:00 2001 From: Lea Date: Tue, 26 Sep 2023 20:24:01 +0200 Subject: [PATCH] init --- README.md | 1 + javascript.Dockerfile | 13 +++++++++++++ typescript.Dockerfile | 14 ++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 README.md create mode 100644 javascript.Dockerfile create mode 100644 typescript.Dockerfile diff --git a/README.md b/README.md new file mode 100644 index 0000000..de0f72e --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Personal Dockerfile templates \ No newline at end of file diff --git a/javascript.Dockerfile b/javascript.Dockerfile new file mode 100644 index 0000000..f89ba99 --- /dev/null +++ b/javascript.Dockerfile @@ -0,0 +1,13 @@ +FROM node:18 as build + +WORKDIR /build/app +COPY package.json /build/app/ +COPY src /build/app/src/ +RUN corepack enable +RUN corepack prepare pnpm@latest --activate +RUN pnpm install + +FROM node:18 as run +WORKDIR /app +COPY --from=build /build/app/ /app/ +CMD ["node", "dist"] diff --git a/typescript.Dockerfile b/typescript.Dockerfile new file mode 100644 index 0000000..baff7a2 --- /dev/null +++ b/typescript.Dockerfile @@ -0,0 +1,14 @@ +FROM node:18 as build + +WORKDIR /build/app +COPY package.json tsconfig.json /build/app/ +COPY src /build/app/src/ +RUN corepack enable +RUN corepack prepare pnpm@latest --activate +RUN pnpm install +RUN pnpm run build + +FROM node:18 as run +WORKDIR /app +COPY --from=build /build/app/ /app/ +CMD ["node", "dist"]