-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (40 loc) · 1.93 KB
/
Dockerfile
File metadata and controls
56 lines (40 loc) · 1.93 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
# ── Build stage ──────────────────────────────────────────────
FROM python:3.13-slim AS builder
WORKDIR /build
COPY pyproject.toml README.md ./
COPY src/ src/
RUN pip install --no-cache-dir build \
&& python -m build --wheel --outdir /build/dist
# ── Runtime stage ────────────────────────────────────────────
FROM python:3.13-slim
LABEL maintainer="POLPROG <polprog.tech@gmail.com>"
LABEL org.opencontainers.image.source="https://github.com/polprog-tech/OpsPortal"
LABEL org.opencontainers.image.description="Unified developer operations portal"
# Non-root user for security
RUN groupadd --gid 1000 portal \
&& useradd --uid 1000 --gid portal --create-home portal
WORKDIR /app
# Install the built wheel
COPY --from=builder /build/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl \
&& rm -rf /tmp/*.whl
# Create data directories
RUN mkdir -p /app/work /app/artifacts \
&& chown -R portal:portal /app
# Copy default manifest if user doesn't mount one
COPY --chown=portal:portal opsportal.yaml /app/opsportal.yaml
USER portal
ENV OPSPORTAL_HOST="0.0.0.0" \
OPSPORTAL_PORT="8080" \
OPSPORTAL_WORK_DIR="/app/work" \
OPSPORTAL_ARTIFACT_DIR="/app/artifacts" \
OPSPORTAL_MANIFEST_PATH="/app/opsportal.yaml"
# Persistent volumes — mount these to retain data across container restarts.
# /app/work — portal state, tool configs, users, audit log, uptime data
# /app/artifacts — generated dashboards, reports, release notes
VOLUME ["/app/work", "/app/artifacts"]
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import httpx; r = httpx.get('http://localhost:8080/api/health'); r.raise_for_status()"
ENTRYPOINT ["opsportal"]
CMD ["serve", "--host", "0.0.0.0", "--port", "8080"]