File size: 1,048 Bytes
0e869bb
 
 
 
 
 
 
 
 
08bd7cf
 
 
 
 
 
 
 
 
 
 
 
 
 
0e869bb
 
 
08bd7cf
 
 
 
 
 
 
 
 
 
0e19599
 
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
# Build stage for React frontend
FROM node:20-slim AS frontend-builder
WORKDIR /web
COPY web/package.json web/package-lock.json ./
RUN npm install --legacy-peer-deps
COPY web/ .
RUN npm run build

# Python backend stage
FROM python:3.11-slim

LABEL maintainer="Ankit Kumar & Jayanth"
LABEL description="SOC Incident Response — OpenEnv environment"

RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# Copy built frontend from builder stage
COPY --from=frontend-builder /web/dist /app/web/dist

RUN pip install --no-cache-dir -e . --no-deps

ENV PORT=7860
EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
  CMD curl -f -X POST http://localhost:7860/reset \
      -H "Content-Type: application/json" \
      -d '{"task_id":"alert_triage"}' || exit 1

#CMD ["python", "root_server.py"]
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]