-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (43 loc) · 1.66 KB
/
Copy pathDockerfile
File metadata and controls
55 lines (43 loc) · 1.66 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
# ==============================================================================
# STAGE 1: Build the React Admin Portal Frontend
# ==============================================================================
FROM node:20-alpine AS frontend-builder
WORKDIR /app/admin
# Copy package descriptors and lockfiles
COPY admin/package*.json ./
RUN npm install
# Copy admin source code
COPY admin/ ./
# Compile/Build static production assets (produces /app/admin/dist)
RUN npm run build
# ==============================================================================
# STAGE 2: Build C Daemon, Ingest Core Engine, and Runtime Server
# ==============================================================================
FROM python:3.12-slim-bookworm AS runner
WORKDIR /app
# Install system dependencies for C compilation, libfcgi, and standard libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
make \
libfcgi-dev \
libfcgi0ldbl \
&& rm -rf /var/lib/apt/lists/*
# Copy workspace source files
COPY src/ ./src/
COPY Makefile ./
# Compile the high-performance C FastCGI Ingestion Daemon
RUN make
# Copy the compiled React static frontend bundle from Stage 1
COPY --from=frontend-builder /app/admin/dist ./admin/dist/
# Create default directories for topics stream storage files
RUN mkdir -p /app/streams
# Configure environment variables for runtime
ENV SLUICEGATE_PORT=2099
ENV SLUICEGATE_INGEST_PATH=/app/streams/ingest.json
ENV PYTHONUNBUFFERED=1
# Expose API Server port (8088) and FastCGI socket port (2099)
EXPOSE 8088
EXPOSE 2099
# Set entrypoint to unified REST + SSE Python server
CMD ["python3", "src/server.py"]