mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 03:01:21 +02:00
Multiple Virtual Printers: - Each VP gets a dedicated bind IP with independent FTP, MQTT, SSDP, and Bind services - New VirtualPrinter DB model, CRUD API (/api/virtual-printers), React UI - VirtualPrinterList, VirtualPrinterCard, VirtualPrinterAddDialog components - Per-instance TLS certificates (shared CA), 11 printer models, all 4 modes - Auto-incremented serial suffixes, network interface override per VP Dual Bind/Detect Ports (#445): - Listen on both ports 3000 and 3002 for slicer bind/detect handshake - Different BambuStudio/OrcaSlicer versions use different ports - Applies to BindServer (server mode) and SlicerProxyManager (proxy mode) - Updated Dockerfile, docker-compose.yml, firewall rules in wiki Also: - Rewrote VP test suite for new multi-instance architecture (75 tests) - Rewritten "How it works" section with 3-step workflow explanation - Updated all 5 locales (en, de, ja, fr, it) - Updated wiki and website for multi-VP + dual ports - New multi-VP screenshot
64 lines
1.7 KiB
Docker
64 lines
1.7 KiB
Docker
# Build frontend
|
|
FROM node:22-bookworm-slim AS frontend-builder
|
|
|
|
WORKDIR /app/frontend
|
|
|
|
# Copy package files first for better caching
|
|
COPY frontend/package*.json ./
|
|
|
|
# Use cache mount for npm
|
|
RUN --mount=type=cache,target=/root/.npm \
|
|
npm ci
|
|
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
# Production image
|
|
FROM python:3.13-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python dependencies with cache mount
|
|
COPY requirements.txt ./
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
pip install --root-user-action=ignore -r requirements.txt
|
|
|
|
# Copy backend
|
|
COPY backend/ ./backend/
|
|
|
|
# Copy built frontend from builder stage
|
|
COPY --from=frontend-builder /app/static ./static
|
|
|
|
# Create data directory for persistent storage
|
|
# chmod 777 allows running as non-root user (e.g., with docker compose user: directive)
|
|
RUN mkdir -p /app/data /app/logs && chmod 777 /app/data /app/logs
|
|
|
|
# Environment variables
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV DATA_DIR=/app/data
|
|
ENV LOG_DIR=/app/logs
|
|
ENV PORT=8000
|
|
|
|
EXPOSE 3000
|
|
EXPOSE 3002
|
|
EXPOSE 8000
|
|
EXPOSE 8883
|
|
EXPOSE 9990
|
|
EXPOSE 50000-50100
|
|
|
|
# Health check (uses PORT env var via shell)
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
|
CMD python -c "import urllib.request, os; urllib.request.urlopen(f'http://localhost:{os.environ.get(\"PORT\", \"8000\")}/health')" || exit 1
|
|
|
|
# Run the application
|
|
# Use standard asyncio loop (uvloop has permission issues in some Docker environments)
|
|
# Port is configurable via PORT environment variable (default: 8000)
|
|
CMD ["sh", "-c", "uvicorn backend.app.main:app --host 0.0.0.0 --port ${PORT:-8000} --loop asyncio"]
|