File size: 2,598 Bytes
d5273f3
ef3a6a2
 
d5273f3
ef3a6a2
d5273f3
 
ef3a6a2
 
d5273f3
3a63028
8a50d96
e3b9c0f
 
412bf8d
e3b9c0f
4f04cfe
 
9f0981f
230fd6a
ef3a6a2
8a50d96
ef3a6a2
 
 
 
 
 
 
 
98d2cb8
34ef861
 
291e2f7
ef3a6a2
805b3d2
de9c884
 
ef3a6a2
 
 
 
714b83d
ef3a6a2
 
 
 
 
c12e4fd
58d7eda
4f04cfe
34ef861
9f0981f
 
5e5fe8d
8e431aa
9f73dae
fe55787
185afee
3a639b9
805b3d2
d262fc5
 
805b3d2
63faace
3a63028
e1bf47d
5e5fe8d
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# ==============================================================================
# STAGE 1: Extract prebuilt OmniRoute production runtime
# No source compilation. No npm install. No Next.js build. No OOM.
# ==============================================================================
FROM diegosouzapw/omniroute:main AS omniroute-source

# ==============================================================================
# STAGE 2: Final Multi-Service Production Runtime
# Assembles all services using prebuilt artifacts only.
# ==============================================================================
FROM debian:bookworm-slim

ENV XDG_DATA_HOME=/data/share
ENV XDG_CONFIG_HOME=/data/config
ENV XDG_CACHE_HOME=/root/.cache
ENV XDG_STATE_HOME=/data/state
ENV DATA_DIR=/data/omniroute
ENV OMNIROUTE_DATA_DIR=/data/omniroute
ENV HOME=/root

# 1. Install runtime system packages only — no build toolchain for OmniRoute
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    ca-certificates \
    git \
    python3 \
    python3-pip \
    nginx \
    gnupg \
    sqlite3 \
    redis-server \
 && rm -rf /var/lib/apt/lists/*

# 2. Install core Python runtime dependencies for Gateway
RUN pip3 install --no-cache-dir \
    aiohttp httpx uvicorn fastapi huggingface_hub \
    --break-system-packages

# 4. Copy prebuilt OmniRoute production runtime from Stage 1
#    /app inside the upstream image contains the complete standalone production server:
#    .next/, server.js (or package.json start script), node_modules/, and Node binary
COPY --from=omniroute-source /app /omniroute

# 5. Copy Node.js runtime from the OmniRoute image (avoids manual curl download)
COPY --from=omniroute-source /usr/local/bin/node /usr/local/bin/node
COPY --from=omniroute-source /usr/local/bin/npm  /usr/local/bin/npm
COPY --from=omniroute-source /usr/local/bin/npx  /usr/local/bin/npx
COPY --from=omniroute-source /usr/local/lib/node_modules /usr/local/lib/node_modules

RUN mkdir -p /root/.cache /data/cache /data/omniroute
RUN chmod -R 777 /root/.cache /data/cache /omniroute /data/omniroute

# 6. Copy Gateway Proxy Application & Entrypoint Scripts
WORKDIR /
COPY entrypoint.sh /entrypoint.sh
COPY nginx.conf /nginx.conf
COPY proxy.py /proxy.py
COPY fix_omniroute.py /fix_omniroute.py
COPY health_doctor.py /health_doctor.py
COPY persistence_manager.py /persistence_manager.py
COPY vault_sync.py /vault_sync.py
COPY gateway /gateway
COPY index.html /index.html
RUN chmod +x /entrypoint.sh /fix_omniroute.py /health_doctor.py /vault_sync.py

EXPOSE 4096

ENTRYPOINT ["/entrypoint.sh"]