aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: f82982c4a574df12655f149c1ff6cc5a2bd7ca51 (plain) (blame)
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
# 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"]
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage