-
-
Notifications
You must be signed in to change notification settings - Fork 304
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (42 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
55 lines (42 loc) · 1.45 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
51
52
53
54
55
# Use a slim Node.js (LTS) image as base
FROM node:22-slim
WORKDIR /app
# Install system dependencies and clean up in single layer
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-dev \
python3-venv \
make \
g++ \
curl \
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install PM2 process manager globally
RUN npm install pm2 -g
# Install Python dependencies for RAG service in a virtual environment
COPY requirements.txt /app/
RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy package files for dependency installation
COPY package*.json ./
# Install node dependencies with clean install
RUN npm ci --only=production && npm cache clean --force
# Copy application source code
COPY . .
# Make startup script executable
RUN chmod +x start-services.sh
# Configure persistent data volume
VOLUME ["/app/data"]
# Configure application port - aber der tatsächliche Port wird durch PAPERLESS_AI_PORT bestimmt
EXPOSE ${PAPERLESS_AI_PORT:-3000}
# Add health check with dynamic port
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:${PAPERLESS_AI_PORT:-3000}/health || exit 1
# Set production environment
ENV NODE_ENV=production
# Start both Node.js and Python services using our script
CMD ["./start-services.sh"]