docmost/Dockerfile

51 lines
1.1 KiB
Docker
Raw Normal View History

FROM node:22-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@10.4.0
2024-06-07 17:21:19 +01:00
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
# 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
# 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/
# Copy patches
COPY --from=builder /app/patches /app/patches
2025-03-06 18:32:25 +00:00
RUN npm install -g pnpm@10.4.0
2024-06-07 17:21:19 +01:00
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"]