-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (26 loc) · 976 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (26 loc) · 976 Bytes
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
FROM python:3.11-slim
# Copyright (c) 2026 Kaushikkumaran
# Apache License 2.0 — see root LICENSE
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Compile Hubble proto stubs at build time.
# grpcio-tools bundles the google/protobuf/*.proto files; the three Cilium
# protos below are everything else the observer service needs.
COPY deps/protos /build/protos
RUN mkdir -p /app/src && python -m grpc_tools.protoc \
-I /build/protos \
--python_out=/app/src \
--grpc_python_out=/app/src \
/build/protos/flow/flow.proto \
/build/protos/relay/relay.proto \
/build/protos/observer/observer.proto
COPY deps /app/deps
COPY src /app/src
# src/ is not a package — flat absolute imports via PYTHONPATH
ENV PYTHONPATH=/app/deps:/app/src
EXPOSE 8003
RUN adduser --disabled-password --gecos "" appuser \
&& chown -R appuser /app
USER appuser
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8003"]