-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (37 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
50 lines (37 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# syntax=docker/dockerfile:1
# Build stage
FROM node:20-slim AS builder
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY webui/package*.json ./webui/
# Install ALL dependencies (including devDependencies for api-server)
RUN npm ci && \
cd webui && \
npm ci --omit=dev
# Production stage
FROM node:20-slim
# Install required system dependencies for ONNX Runtime
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
wget \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy dependencies from builder
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/webui/node_modules ./webui/node_modules
# Copy application code
COPY . .
# Create models directory with proper permissions
RUN mkdir -p models && \
chown -R node:node /app
# Switch to non-root user
USER node
# Expose ports for API server (3001) and Web UI (3000)
EXPOSE 3001 3000
# Default command runs the API microservice
# Override with: docker run ... semantic-chunking node webui/server.js
CMD ["node", "api-server.js"]