-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (35 loc) · 1.19 KB
/
Dockerfile
File metadata and controls
45 lines (35 loc) · 1.19 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
FROM python:3.11-slim
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PIP_NO_CACHE_DIR=1
WORKDIR /app
COPY pyproject.toml README.md ./
COPY app.py ./
COPY src ./src
COPY scripts ./scripts
RUN python -m pip install --upgrade pip \
&& python -m pip install .
ENV SCENESMITH_COMPAT_HOST=0.0.0.0
ENV SCENESMITH_COMPAT_PORT=8005
ENV HSSD_DATA_PATH=/app/data/hssd-models
ENV HSSD_PREPROCESSED_PATH=/app/data/preprocessed
ENV HSSD_HOST=0.0.0.0
ENV HSSD_PORT=8006
ENV HSSD_ARTIFACT_ROOT=/app/artifacts/hssd_service
ENV AMBIENTCG_DATA_PATH=/app/data/materials
ENV AMBIENTCG_EMBEDDINGS_PATH=/app/data/materials/embeddings
ENV AMBIENTCG_HOST=0.0.0.0
ENV AMBIENTCG_PORT=8007
ENV AMBIENTCG_ARTIFACT_ROOT=/app/artifacts/ambientcg_service
EXPOSE 8005 8006 8007
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD python - <<'PY' || exit 1
import json
import urllib.request
for url in ("http://127.0.0.1:8006/healthz", "http://127.0.0.1:8007/healthz"):
with urllib.request.urlopen(url, timeout=5) as response:
payload = json.loads(response.read().decode("utf-8"))
if payload.get("status") != "ok":
raise SystemExit(1)
print("ok")
PY
CMD ["bash", "scripts/docker-entrypoint.sh"]