From 718323c142a6f571bd36e6a21383f520326039de Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Wed, 21 Feb 2024 10:32:48 +1000 Subject: [PATCH] dockerfile --- .dockerignore | 5 +++++ docker/Dockerfile | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .dockerignore create mode 100644 docker/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..61dbbef8de --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +pnpm-lock.yaml +.git +.gitignore +dist \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000000..bb6821262f --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,17 @@ +FROM node:21-slim AS base +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable +COPY . /app +WORKDIR /app + +FROM base AS prod-deps +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod + +FROM base AS build +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install +RUN pnpm run build + +FROM httpd:2.4 AS runtime +COPY --from=build /app/dist /usr/local/apache2/htdocs/ +EXPOSE 80 \ No newline at end of file