ProxmoxBackupClientPBSClien.../docker/Dockerfile
zaphod-black 0746428435 Fix Docker web dashboard with Python HTTP server + blue/purple neon theme
PROBLEM SOLVED:
The netcat-based HTTP server had a fundamental bidirectional pipe issue:
- `( read method path ) | nc -l` only connects stdout→stdin in one direction
- The `read` command couldn't receive HTTP request data from nc
- All requests returned "Not found" despite correct routing logic

SOLUTION:
- Created api-server.py: Proper Python HTTP server using http.server
- Handles dashboard (GET /), status, health, logs, and backup trigger (POST)
- Full request/response handling with proper HTTP headers
- Replaces broken netcat approach with robust solution

DASHBOARD ENHANCEMENTS:
- Changed from green terminal theme to blue/purple neon aesthetic
  - Primary: #00d4ff (cyan blue)
  - Accent: #aa00ff (purple)
  - Background: #0a0a14 (dark blue-black)
- Increased all font sizes 2-4px for better readability
- Enhanced button padding and spacing
- More visible, high-contrast interface

TECHNICAL DETAILS:
- Dockerfile: Replaced netcat-openbsd with python3 dependency
- api-server.sh: Now simple wrapper that exec's Python script
- api-server.py: Full-featured HTTP server with JSON/HTML responses
- dashboard.html: Updated color scheme and typography

TESTING:
 Dashboard loads at http://localhost:8080/
 /status endpoint returns JSON
 /health endpoint working
 /logs endpoint working
 Real-time backup monitoring ready

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 23:25:10 -06:00

67 lines
2 KiB
Docker

# Proxmox Backup Client - Docker Container
# Cross-platform PBS client for Windows, Mac, and Linux
FROM debian:bookworm-slim
# Metadata
LABEL maintainer="PBSClientTool"
LABEL description="Cross-platform Proxmox Backup Client with scheduler"
LABEL version="1.0.0"
# Install dependencies
RUN apt-get update && \
apt-get install -y \
wget \
gnupg \
cron \
curl \
jq \
python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Add Proxmox repository and install PBS client
RUN wget -q https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg \
-O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg && \
echo "deb [arch=amd64] http://download.proxmox.com/debian/pbs-client bookworm main" \
> /etc/apt/sources.list.d/pbs-client.list && \
apt-get update && \
apt-get install -y proxmox-backup-client && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create directories
RUN mkdir -p /config /backup-scripts /host-data /logs
# Copy scripts
COPY scripts/entrypoint.sh /usr/local/bin/
COPY scripts/backup.sh /usr/local/bin/pbs-backup
COPY scripts/healthcheck.sh /usr/local/bin/healthcheck
COPY scripts/api-server.sh /usr/local/bin/api-server
COPY scripts/api-server.py /usr/local/bin/api-server.py
COPY scripts/dashboard.html /usr/local/share/dashboard.html
RUN chmod +x /usr/local/bin/entrypoint.sh \
/usr/local/bin/pbs-backup \
/usr/local/bin/healthcheck \
/usr/local/bin/api-server \
/usr/local/bin/api-server.py
# Expose API port (optional)
EXPOSE 8080
# Health check
HEALTHCHECK --interval=5m --timeout=10s --start-period=30s --retries=3 \
CMD /usr/local/bin/healthcheck
# Default environment variables
ENV MODE=daemon \
BACKUP_SCHEDULE="0 2 * * *" \
BACKUP_PATHS="/host-data" \
EXCLUDE_PATTERNS="/host-data/tmp /host-data/var/tmp /host-data/proc /host-data/sys /host-data/dev" \
TIMEZONE=UTC
VOLUME ["/config", "/logs", "/host-data"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["daemon"]