Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (33 loc) · 1.59 KB
/
Copy pathDockerfile
File metadata and controls
34 lines (33 loc) · 1.59 KB
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
# Build the web client. Plain JS comes out, the same for every CPU: build it once, natively, even for arm64 images.
# The clients are npm workspaces (docs/adr/001-client-architecture.md): the root lock, the shared packages and every
# workspace's manifest go in so `npm ci` can resolve, then only the web workspace is installed and built.
FROM --platform=$BUILDPLATFORM node:24-slim AS web
WORKDIR /src
COPY package.json package-lock.json ./
COPY packages/ ./packages/
COPY web/package.json ./web/
COPY mobile/package.json ./mobile/
COPY desktop/ui/package.json ./desktop/ui/
RUN npm ci --no-audit --no-fund -w web
COPY web/ ./web/
RUN npm run build -w web
# Backend; also serves the built client from the same origin.
FROM python:3.13-slim
WORKDIR /app
# The soundboard transcodes every upload with ffmpeg (subprocess); the slim image has none.
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*
COPY server/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Runs as this unprivileged user; deploy/install.sh gives it the data folder.
RUN useradd --system --uid 10001 --no-create-home --shell /usr/sbin/nologin atrium
COPY server/app.py ./
COPY server/atrium ./atrium
COPY --from=web /src/web/dist ./web
ENV WEB_DIST=/app/web \
DATA_DIR=/data \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
VOLUME ["/data"]
USER 10001:10001
# Host networking: only Caddy on the same machine talks to this port.
CMD ["uvicorn", "app:app", "--host", "127.0.0.1", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips", "127.0.0.1", "--no-server-header"]