mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
64 lines
1.7 KiB
Docker
64 lines
1.7 KiB
Docker
FROM node:18-alpine AS base
|
|
|
|
# [Stage 1] Prune the plane-deploy Project and lockfile out the monorepo.
|
|
FROM base AS builder
|
|
RUN apk add --no-cache libc6-compat
|
|
RUN apk update
|
|
|
|
# Installing turbo, copying monorepo and executing prune
|
|
WORKDIR /app
|
|
RUN yarn global add turbo
|
|
COPY . .
|
|
|
|
# plane-deploy pruned as /app/out/json (deps) and /app/out/full (plane-deploy)
|
|
RUN turbo prune --scope=plane-deploy --docker
|
|
|
|
# [Stage 2] Install Dependencies from deps only files from /app/out/json
|
|
FROM base AS installer
|
|
RUN apk add --no-cache libc6-compat
|
|
RUN apk add tree
|
|
RUN apk update
|
|
WORKDIR /app
|
|
|
|
# Copying package.json and lockfile from plane-deploy and also from root, as /app/out/yarn-lock.json and /app/out/json
|
|
COPY --from=builder /app/out/json/ .
|
|
COPY --from=builder /app/out/yarn.lock ./yarn.lock
|
|
RUN yarn install
|
|
|
|
# Building the Project with standalone mode ( https://nextjs.org/docs/pages/api-reference/next-config-js/output )
|
|
COPY --from=builder ./app/out/full .
|
|
RUN yarn turbo run build --filter=plane-deploy
|
|
# CMD tree ./apps -I 'node_modules'
|
|
|
|
# [Stage: 3] Running the project
|
|
FROM base AS runner
|
|
WORKDIR /app
|
|
|
|
# Creating user group for production, plane as usergroup and captain as user
|
|
RUN addgroup --system --gid 1001 plane
|
|
RUN adduser --system --uid 1001 captain
|
|
USER captain
|
|
|
|
# transporting package files from installer
|
|
COPY --from=installer /app/apps/space/next.config.js .
|
|
COPY --from=installer /app/apps/space/package.json .
|
|
|
|
# transporting builds from installer
|
|
COPY --from=installer --chown=captain:plane /app/apps/space/.next/standalone ./
|
|
COPY --from=installer --chown=captain:plane /app/apps/space/.next ./apps/space/.next
|
|
|
|
# Start the server
|
|
CMD node apps/space/server.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|