docmost/Dockerfile

47 lines
966 B
Docker
Raw Normal View History

2024-06-07 17:21:19 +01:00
FROM node:21-alpine AS base
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
# 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/
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"]