-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.backend
More file actions
46 lines (36 loc) · 1.37 KB
/
Dockerfile.backend
File metadata and controls
46 lines (36 loc) · 1.37 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
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements
COPY requirements-backend.txt .
# Make pip more resilient to transient package index/network hiccups in CI.
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_DEFAULT_TIMEOUT=120
# Install Python dependencies
RUN pip install --no-cache-dir \
--retries 10 \
--timeout 120 \
--prefer-binary \
-r requirements-backend.txt
# Copy application files
COPY docs/archive/legacy/code/fl_metrics_translator.py ./fl_metrics_translator.py
COPY docs/archive/legacy/code/spatial_threat_analyzer.py ./spatial_threat_analyzer.py
COPY docs/archive/legacy/code/sovereign_federation_backend.py ./sovereign_federation_backend.py
COPY docs/archive/legacy/code/sovereignmap_production_backend.py ./sovereignmap_production_backend.py
COPY sovereignmap_production_backend_v2.py ./sovereignmap_production_backend_v2.py
COPY docs/archive/week2/code/bft_week2_*.py ./tests/
# Create data directory
RUN mkdir -p /app/data
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# Expose port
EXPOSE 8000
# Run application
CMD ["python", "sovereignmap_production_backend_v2.py"]