31 lines
831 B
Docker
31 lines
831 B
Docker
# Build from Fileverse collaboration-server source
|
|
# https://github.com/fileverse/collaboration-server
|
|
# Uses tsup for ESM build, requires Node 23.x
|
|
|
|
FROM node:23-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Clone and build collaboration-server
|
|
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* && \
|
|
git clone --depth 1 https://github.com/fileverse/collaboration-server.git . && \
|
|
npm ci && \
|
|
npm run build
|
|
|
|
FROM node:23-slim
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/package.json ./
|
|
|
|
# Default port from config
|
|
EXPOSE 5001
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
|
CMD node -e "fetch('http://localhost:5001/health').then(r => process.exit(r.ok ? 0 : 1))"
|
|
|
|
CMD ["node", "dist/index.js"]
|