/
/
/
Ansible role that deployes services on my runner machine
1# LiveKit Meet - browser conferencing frontend + token generator
2# Generated by Ansible - DO NOT EDIT MANUALLY
3#
4# LiveKit does not publish a prebuilt image for Meet, so it is built from
5# source here. Meet is a Next.js app that also serves the token endpoint at
6# /api/connection-details, signing JWTs server-side with the API secret.
7
8FROM node:{{ livekit_meet_node_version }} AS builder
9
10ARG MEET_REPO_URL={{ livekit_meet_repo_url }}
11ARG MEET_REPO_VERSION={{ livekit_meet_repo_version }}
12
13# git-lfs is required: Meet tracks public/background-images/*.jpg via LFS, and
14# without it the checkout yields pointer files that fail the Next.js image
15# import at build time.
16RUN apk add --no-cache git git-lfs
17
18WORKDIR /build
19
20# Fetch the pinned ref. Uses init+fetch rather than clone --branch because the
21# ref is a commit SHA, which --branch does not accept.
22RUN set -eux; \
23 git init -q .; \
24 git lfs install --local; \
25 git remote add origin "${MEET_REPO_URL}"; \
26 git fetch --depth 1 origin "${MEET_REPO_VERSION}"; \
27 git checkout -q FETCH_HEAD; \
28 git lfs pull; \
29 echo "Building LiveKit Meet from ${MEET_REPO_URL}@${MEET_REPO_VERSION}"; \
30 git rev-parse HEAD > /build/.meet-revision; \
31 rm -rf .git
32
33# Meet ships a pnpm lockfile and pins its own pnpm version via packageManager
34RUN corepack enable && corepack prepare pnpm@{{ livekit_meet_pnpm_version }} --activate
35RUN pnpm install --frozen-lockfile
36
37# Meet's next.config.js does not set output:'standalone', so the standalone
38# bundle is never emitted. Enable it here rather than patching upstream, which
39# lets the runtime stage ship without node_modules.
40RUN set -eux; \
41 if ! grep -q "output:.*standalone" next.config.js; then \
42 sed -i "s/const nextConfig = {/const nextConfig = {\n output: 'standalone',/" next.config.js; \
43 fi; \
44 grep -q "output:.*standalone" next.config.js
45
46ENV NEXT_TELEMETRY_DISABLED=1
47RUN pnpm build
48
49# ------------------------------------------------------------------------------
50
51FROM node:{{ livekit_meet_node_version }} AS runtime
52
53ENV NODE_ENV=production \
54 NEXT_TELEMETRY_DISABLED=1 \
55 PORT={{ livekit_meet_port }} \
56 HOSTNAME=0.0.0.0
57
58RUN apk add --no-cache curl && \
59 addgroup -g 1001 -S nodejs && \
60 adduser -u 1001 -S nextjs -G nodejs
61
62WORKDIR /app
63
64COPY --from=builder /build/.meet-revision ./.meet-revision
65COPY --from=builder --chown=nextjs:nodejs /build/.next/standalone ./
66COPY --from=builder --chown=nextjs:nodejs /build/.next/static ./.next/static
67COPY --from=builder --chown=nextjs:nodejs /build/public ./public
68
69USER nextjs
70
71EXPOSE {{ livekit_meet_port }}
72
73CMD ["node", "server.js"]
74