FROM node:22-alpine AS builder RUN apk add git WORKDIR /app RUN git clone https://github.com/CorentinTh/enclosed WORKDIR /app/enclosed RUN npm install -g pnpm --ignore-scripts && \ pnpm install --frozen-lockfile --ignore-scripts RUN pnpm --filter @enclosed/crypto run build && \ pnpm --filter @enclosed/lib run build && \ pnpm --filter @enclosed/app-client run build && \ pnpm --filter @enclosed/app-server run build:node FROM node:22-alpine WORKDIR /app COPY --from=builder /app/enclosed/packages/app-client/dist ./public COPY --from=builder /app/enclosed/packages/app-server/dist-node/index.cjs ./index.cjs RUN mkdir -p /app/.data && chmod 777 /app/.data EXPOSE 8787 CMD ["node", "index.cjs"]