From 4dd1531a9cc925c2dfdfdf0a79a6193d36896a51 Mon Sep 17 00:00:00 2001 From: Chris Grimmett Date: Mon, 26 Feb 2024 14:00:23 -0800 Subject: [PATCH] switch back to dokku --- .dokku/README.md | 3 +++ .dokku/next.app.json | 8 ++++++++ next.Dockerfile | 25 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 .dokku/README.md create mode 100644 .dokku/next.app.json create mode 100644 next.Dockerfile diff --git a/.dokku/README.md b/.dokku/README.md new file mode 100644 index 0000000..de1395d --- /dev/null +++ b/.dokku/README.md @@ -0,0 +1,3 @@ +https://dokku.com/docs/advanced-usage/deployment-tasks/?h=monorepo#changing-the-appjson-location + +https://dokku.com/docs/deployment/builders/dockerfiles/ \ No newline at end of file diff --git a/.dokku/next.app.json b/.dokku/next.app.json new file mode 100644 index 0000000..52a68e0 --- /dev/null +++ b/.dokku/next.app.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "dokku": { + "predeploy": "echo hello-world-predeploy", + "postdeploy": "echo hello-world-postdeploy" + } + } +} \ No newline at end of file diff --git a/next.Dockerfile b/next.Dockerfile new file mode 100644 index 0000000..cdb9e38 --- /dev/null +++ b/next.Dockerfile @@ -0,0 +1,25 @@ +FROM node:20-slim AS base +ENV NEXT_TELEMETRY_DISABLED 1 +RUN corepack enable + +FROM base AS build +WORKDIR /usr/src/fp-monorepo +RUN mkdir /usr/src/next +COPY ./pnpm-lock.yaml ./ +COPY ./pnpm-workspace.yaml ./ +COPY ./packages/next/package.json ./packages/next/ +RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store pnpm install +COPY . . +RUN pnpm deploy --filter=fp-next /usr/src/next + +FROM base AS dev +WORKDIR /app +COPY --from=build /usr/src/next /app +CMD ["pnpm", "run", "dev"] + +FROM base AS next +WORKDIR /app +COPY --from=build /usr/src/next /app +COPY ./packages/next/app.json /app +ENTRYPOINT ["pnpm"] +CMD ["start"] \ No newline at end of file