# Multi-arch (linux/amd64, linux/arm64) image for the TeamSpeak 6 dashboard + browser voice gateway. FROM node:22-bookworm-slim AS node-runtime FROM python:3.13-slim-bookworm # Copy Node.js 22 runtime (required by @honeybbq/teamspeak and process.loadEnvFile) COPY --from=node-runtime /usr/local/bin/node /usr/local/bin/node COPY --from=node-runtime /usr/local/lib/node_modules /usr/local/lib/node_modules RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ && useradd --create-home --shell /bin/bash appuser WORKDIR /app # Install Python dependencies first (cached layer) COPY pyproject.toml ./ RUN pip install --no-cache-dir \ "flask>=3.1.3" \ "flask-cors>=6.0.5" \ "python-dotenv>=1.0.1" \ "requests>=2.34.2" # Install Node.js voice gateway dependencies (pure JS + WASM, no native compilation needed on arm64) COPY gateway/package.json gateway/package-lock.json* ./gateway/ RUN npm --prefix ./gateway ci --omit=dev --no-audit --no-fund \ || npm --prefix ./gateway install --omit=dev --no-audit --no-fund # Copy application source COPY app.py config.py run.py config.toml index.css ./ COPY static ./static COPY gateway/src ./gateway/src RUN chown -R appuser:appuser /app USER appuser ENV PYTHONUNBUFFERED=1 \ WEB_HOST=0.0.0.0 \ WEB_PORT=5000 EXPOSE 5000 HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD node -e "fetch('http://127.0.0.1:' + (process.env.WEB_PORT || 5000) + '/healthz').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))" CMD ["python", "run.py"]