2024-06-07 17:21:19 +01:00
|
|
|
FROM node:21-alpine AS base
|
2024-08-20 14:09:36 +02:00
|
|
|
LABEL org.opencontainers.image.source="https://github.com/docmost/docmost"
|
2024-06-07 17:21:19 +01:00
|
|
|
|
2024-06-28 17:29:46 +01:00
|
|
|
FROM base AS builder
|
2024-06-07 17:21:19 +01:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN npm install -g pnpm
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
RUN pnpm build
|
|
|
|
|
2024-06-28 17:29:46 +01:00
|
|
|
FROM base AS installer
|
2024-06-07 17:21:19 +01:00
|
|
|
|
|
|
|
RUN apk add --no-cache curl bash
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2024-06-27 15:32:23 +01:00
|
|
|
# Copy apps
|
2024-06-07 17:21:19 +01:00
|
|
|
COPY --from=builder /app/apps/server/dist /app/apps/server/dist
|
|
|
|
COPY --from=builder /app/apps/client/dist /app/apps/client/dist
|
|
|
|
COPY --from=builder /app/apps/server/package.json /app/apps/server/package.json
|
2024-06-27 15:32:23 +01:00
|
|
|
|
|
|
|
# Copy packages
|
|
|
|
COPY --from=builder /app/packages/editor-ext/dist /app/packages/editor-ext/dist
|
|
|
|
COPY --from=builder /app/packages/editor-ext/package.json /app/packages/editor-ext/package.json
|
|
|
|
|
|
|
|
# Copy root package files
|
2024-06-07 17:21:19 +01:00
|
|
|
COPY --from=builder /app/package.json /app/package.json
|
|
|
|
COPY --from=builder /app/pnpm*.yaml /app/
|
2024-06-27 15:32:23 +01:00
|
|
|
|
2024-10-14 17:13:36 +09:00
|
|
|
# Copy patches
|
|
|
|
COPY --from=builder /app/patches /app/patches
|
|
|
|
|
2024-06-07 17:21:19 +01:00
|
|
|
RUN npm install -g pnpm
|
|
|
|
|
|
|
|
RUN chown -R node:node /app
|
|
|
|
|
|
|
|
USER node
|
|
|
|
|
|
|
|
RUN pnpm install --frozen-lockfile --prod
|
|
|
|
|
2024-06-27 15:07:48 +01:00
|
|
|
RUN mkdir -p /app/data/storage
|
2024-06-07 17:21:19 +01:00
|
|
|
|
2024-06-27 15:07:48 +01:00
|
|
|
VOLUME ["/app/data/storage"]
|
2024-06-07 17:21:19 +01:00
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
CMD ["pnpm", "start"]
|