-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (45 loc) · 1.72 KB
/
Dockerfile
File metadata and controls
54 lines (45 loc) · 1.72 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
# syntax=docker/dockerfile:1.7
# =============================================================================
# python — Astronomical Transient Triage
# =============================================================================
# Base: python:3.12-slim. Installs `agentruntimecontrolprotocol@${ARCP_SDK_VERSION}`
# from PyPI, plus the science stack (astropy, numpy, matplotlib, textual).
# The `ROLE` env var picks runtime | alert-source | client at container start.
# -----------------------------------------------------------------------------
FROM python:3.12-slim AS base
ARG ARCP_SDK_VERSION=latest
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
tini ca-certificates build-essential libfreetype6-dev \
&& rm -rf /var/lib/apt/lists/*
COPY pyproject.toml ./
# Install the ARCP SDK at the requested version. `latest` resolves to the
# newest published release on PyPI at build time.
RUN if [ "$ARCP_SDK_VERSION" = "latest" ]; then \
pip install --upgrade "agentruntimecontrolprotocol"; \
else \
pip install "agentruntimecontrolprotocol==${ARCP_SDK_VERSION}"; \
fi \
&& pip install \
"httpx>=0.27" \
"websockets>=13" \
"astropy>=6.0" \
"numpy>=1.26" \
"matplotlib>=3.8" \
"textual>=0.60" \
"aiosqlite>=0.20" \
"pydantic>=2.7"
COPY src/ ./src/
COPY alerts/ ./alerts/
COPY catalogs/ ./catalogs/
ENV PYTHONPATH=/app/src \
ALERT_CORPUS_DIR=/app/alerts \
LOCAL_CATALOG_DIR=/app/catalogs \
ARTIFACT_DIR=/app/night_reports
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["python", "-m", "main"]