-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
79 lines (57 loc) · 2.16 KB
/
Dockerfile
File metadata and controls
79 lines (57 loc) · 2.16 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# ============================================================
# Backend — processing services for a specific instrument
# ============================================================
FROM python:3.13-slim AS backend
ARG SETUPTOOLS_SCM_PRETEND_VERSION
ARG INSTRUMENT
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgomp1 \
tini \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd --gid 1000 livedata && \
useradd --uid 1000 --gid 1000 --create-home --shell /usr/sbin/nologin livedata
WORKDIR /app
COPY . .
RUN pip install --no-cache-dir -e ".[${INSTRUMENT}]"
ENV LIVEDATA_DATA_DIR=/app/data/geometry
RUN python -m ess.livedata.handlers.download_geometry
USER livedata
ENV LIVEDATA_ENV=docker \
LIVEDATA_INSTRUMENT=${INSTRUMENT} \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
ENTRYPOINT ["tini", "--"]
# TODO: Replace with HTTP health endpoint (e.g., curl -sf http://localhost:8080/health)
# once backend services expose liveness/readiness checks.
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import ess.livedata; print('ok')" || exit 1
# ============================================================
# Dashboard — reduction dashboard for a specific instrument
# ============================================================
FROM python:3.13-slim AS dashboard
ARG SETUPTOOLS_SCM_PRETEND_VERSION
ARG INSTRUMENT
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgomp1 \
tini \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd --gid 1000 livedata && \
useradd --uid 1000 --gid 1000 --create-home --shell /usr/sbin/nologin livedata
WORKDIR /app
COPY . .
RUN pip install --no-cache-dir -e ".[${INSTRUMENT},dashboard]"
USER livedata
EXPOSE 5009
ENV LIVEDATA_ENV=docker \
LIVEDATA_INSTRUMENT=${INSTRUMENT} \
BOKEH_ALLOW_WS_ORIGIN=* \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
ENTRYPOINT ["tini", "--"]
CMD ["python", "-m", "ess.livedata.dashboard.reduction"]
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -sf http://localhost:5009/ || exit 1