-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.node-agent
More file actions
31 lines (23 loc) · 896 Bytes
/
Dockerfile.node-agent
File metadata and controls
31 lines (23 loc) · 896 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
FROM python:3.11-slim
WORKDIR /app
# Runtime dependencies for FL client containers
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Use CPU-only PyTorch wheels to avoid pulling CUDA runtime packages in CI/dev containers.
RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu \
torch==2.1.0+cpu \
torchvision==0.16.0+cpu \
&& pip install --no-cache-dir \
flwr==1.7.0 \
opacus==1.4.0 \
numpy==1.24.3 \
cryptography==41.0.7
COPY src/ ./src/
RUN useradd --system --create-home --uid 10001 appuser && chown -R appuser:appuser /app
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
USER appuser
# Default command can be overridden by docker-compose command.
CMD ["python", "-u", "src/client.py", "--node-id", "1", "--aggregator", "backend:8080"]