-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 899 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (25 loc) · 899 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
32
33
# ASPL reference node — minimal container.
FROM python:3.11-slim
# Non-root user for security.
RUN useradd -m -u 1001 -s /bin/bash aspl
WORKDIR /app
# Install dependencies first for better layer caching.
COPY pyproject.toml ./
COPY aspl ./aspl
COPY sdk ./sdk
COPY conformance ./conformance
RUN pip install --no-cache-dir .
# Persist the database, node key and audit log outside the image.
ENV ASPL_DB=/data/aspl.db \
ASPL_SHOP_KEY=/data/.shop_key \
ASPL_AUDIT_LOG=/data/audit.jsonl \
ASPL_HOST=0.0.0.0 \
ASPL_PORT=5010
RUN mkdir -p /data && chown aspl:aspl /data
VOLUME ["/data"]
EXPOSE 5010
USER aspl
# Lightweight liveness check against the node's root endpoint.
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:5010/').status==200 else 1)"
CMD ["aspl-server"]