mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 14:01:45 +02:00
68 lines
2.1 KiB
Docker
68 lines
2.1 KiB
Docker
FROM node:20-alpine AS base
|
|
# The web Dockerfile is copy-pasted into our main docs at /docs/handbook/deploying-with-docker.
|
|
# Make sure you update this Dockerfile, the Dockerfile in the web workspace and copy that over to Dockerfile in the docs.
|
|
|
|
FROM base AS builder
|
|
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
|
RUN apk update
|
|
RUN apk add --no-cache libc6-compat
|
|
# Set working directory
|
|
WORKDIR /app
|
|
RUN yarn global add turbo
|
|
COPY . .
|
|
RUN turbo prune silo --docker
|
|
|
|
# Add lockfile and package.json's of isolated subworkspace
|
|
FROM base AS installer
|
|
RUN apk update
|
|
RUN apk add --no-cache libc6-compat
|
|
WORKDIR /app
|
|
|
|
# First install dependencies (as they change less often)
|
|
COPY .gitignore .gitignore
|
|
COPY --from=builder /app/out/json/ .
|
|
COPY --from=builder /app/out/yarn.lock ./yarn.lock
|
|
RUN yarn install
|
|
|
|
# Build the project and its dependencies
|
|
COPY --from=builder /app/out/full/ .
|
|
COPY turbo.json turbo.json
|
|
|
|
ENV TURBO_TELEMETRY_DISABLED 1
|
|
|
|
RUN yarn turbo build --filter=silo
|
|
|
|
# Sentry source maps upload stage
|
|
FROM base AS sentry-upload
|
|
WORKDIR /app
|
|
|
|
# Environment variables for Sentry (use --build-arg to pass them securely during build)
|
|
ARG SENTRY_AUTH_TOKEN
|
|
ARG SENTRY_ORG
|
|
ARG SENTRY_PROJECT
|
|
ARG SENTRY_RELEASE_VERSION
|
|
|
|
ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
|
|
ENV SENTRY_ORG=$SENTRY_ORG
|
|
ENV SENTRY_PROJECT=$SENTRY_PROJECT
|
|
ENV SENTRY_RELEASE_VERSION=$SENTRY_RELEASE_VERSION
|
|
|
|
# Run the Sentry source maps upload
|
|
RUN yarn sentry:sourcemaps
|
|
|
|
FROM base AS runner
|
|
WORKDIR /app
|
|
|
|
COPY --from=installer /app/packages ./packages
|
|
COPY --from=installer /app/silo/dist ./silo
|
|
COPY --from=installer /app/silo/package.json ./silo/package.json
|
|
COPY --from=installer /app/silo/src/db/migrations ./silo/src/db/migrations
|
|
COPY --from=installer /app/silo/src/db/config ./silo/src/db/config
|
|
COPY --from=installer /app/silo/drizzle.config.js ./silo/drizzle.config.js
|
|
COPY --from=installer /app/silo/wait_db.js ./silo/wait_db.js
|
|
COPY --from=installer /app/node_modules ./node_modules
|
|
|
|
ENV TURBO_TELEMETRY_DISABLED 1
|
|
|
|
EXPOSE 3000
|