-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 1.29 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (31 loc) · 1.29 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
FROM python:3.11-slim AS builder
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends gcc g++ python3-dev && rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
FROM python:3.11-slim AS runtime
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends redis-server && rm -rf /var/lib/apt/lists/*
RUN groupadd -r architect && useradd -r -g architect formaluser
RUN mkdir -p /var/run/redis /var/log/redis /var/lib/redis && \
chown -R formaluser:architect /var/run/redis /var/log/redis /var/lib/redis
USER formaluser
COPY --from=builder /root/.local /home/formaluser/.local
ENV PATH=/home/formaluser/.local/bin:$PATH
ENV PYTHONPATH=.
COPY src/ ./src/
COPY tests/ ./tests/
COPY locustfile.py .
COPY requirements.txt .
# --- EXPOSE THE NATIVE PROMETHEUS SCRAPE ENDPOINT PORT ---
EXPOSE 8000
EXPOSE 6379
RUN cat << 'INNER_EOF' > entrypoint.sh
#!/bin/sh
echo "🗄️ Starting localized in-memory Redis server background instance..."
redis-server --daemonize yes --port 6379 --protected-mode no --dir /var/lib/redis
echo "⚡ Booting high-throughput low-latency symbolic orchestration loop engine..."
exec python src/infrastructure/orchestrator.py
INNER_EOF
RUN chmod +x entrypoint.sh
CMD ["./entrypoint.sh"]