From 96bfe2e1505b4ae250f2d5201f9541ceb01cec84 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 29 Oct 2026 19:58:05 -0700 Subject: ts web slopify code --- Dockerfile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f82982c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,44 @@ +# 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"] -- cgit v1.2.3