-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (46 loc) · 1.67 KB
/
Dockerfile
File metadata and controls
61 lines (46 loc) · 1.67 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
# =============================================================================
# DC Overview - Docker Image
# GPU Datacenter Monitoring Web Application
# =============================================================================
FROM python:3.11-slim
LABEL org.opencontainers.image.source="https://github.com/cryptolabsza/dc-overview"
LABEL org.opencontainers.image.description="GPU Datacenter Monitoring - Server Management & Prometheus Targets"
LABEL org.opencontainers.image.licenses="MIT"
# Build arguments for version info
ARG GIT_COMMIT=unknown
ARG GIT_BRANCH=unknown
ARG BUILD_TIME=unknown
# Set as environment variables (available at runtime)
ENV GIT_COMMIT=${GIT_COMMIT}
ENV GIT_BRANCH=${GIT_BRANCH}
ENV BUILD_TIME=${BUILD_TIME}
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
openssh-client \
sshpass \
&& rm -rf /var/lib/apt/lists/*
# Create app user and directories
RUN useradd -m -s /bin/bash dcuser && \
mkdir -p /app /data /etc/dc-overview/ssh_keys && \
chown -R dcuser:dcuser /app /data /etc/dc-overview
WORKDIR /app
# Copy and install the package
COPY --chown=dcuser:dcuser . /app/
# Install dc-overview
RUN pip install --no-cache-dir -e .
# Environment variables
ENV DC_OVERVIEW_PORT=5001
ENV DC_OVERVIEW_DATA=/data
ENV PYTHONUNBUFFERED=1
# Expose port
EXPOSE 5001
# Volume for persistent data
VOLUME ["/data", "/etc/dc-overview"]
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -f http://localhost:${DC_OVERVIEW_PORT}/api/health || exit 1
# Run as app user
USER dcuser
# Start the web server
CMD ["dc-overview", "serve", "--host", "0.0.0.0"]