-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.dashboard
More file actions
50 lines (38 loc) · 1.4 KB
/
Dockerfile.dashboard
File metadata and controls
50 lines (38 loc) · 1.4 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
# FluxAI Dashboard - Dockerfile
# Streamlit-based observability dashboard with Prometheus and PostgreSQL integration
FROM python:3.11-slim
# Metadata
LABEL maintainer="FluxAI Team"
LABEL description="FluxAI Observability Dashboard - Real-time metrics and analytics"
LABEL version="1.0.0"
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
STREAMLIT_SERVER_PORT=8501 \
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install only dashboard dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir streamlit==1.29.0 plotly==5.18.0 pandas==2.1.4 sqlalchemy==2.0.23 httpx==0.25.2 structlog==23.2.0
# Copy dashboard code
COPY ./dashboard ./dashboard
# Create non-root user for security
RUN useradd -m -u 1000 fluxai && \
chown -R fluxai:fluxai /app
# Switch to non-root user
USER fluxai
# Expose Streamlit port
EXPOSE 8501
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8501/_stcore/health || exit 1
# Run Streamlit dashboard
CMD ["streamlit", "run", "dashboard/app.py", "--server.port=8501", "--server.address=0.0.0.0"]