Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

build(media-server): use debian-based image with ffmpeg and frozen installs

Richie McIlroy8c4a91677e29
diff --git a/apps/media-server/Dockerfile b/apps/media-server/Dockerfile
index 826ef6a1d..754bd9f2b 100644
--- a/apps/media-server/Dockerfile
+++ b/apps/media-server/Dockerfile
@@ -1,11 +1,13 @@
-FROM oven/bun:1-alpine
+FROM oven/bun:1
-RUN apk add --no-cache ffmpeg
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends ffmpeg \
+ && rm -rf /var/lib/apt/lists/*
WORKDIR /app
-COPY apps/media-server/package.json ./
-RUN bun install --production
+COPY apps/media-server/package.json apps/media-server/bun.lock ./
+RUN bun install --frozen-lockfile --production
COPY apps/media-server/src ./src
@@ -13,6 +15,6 @@ ENV PORT=3456
EXPOSE 3456
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
- CMD wget -qO- http://localhost:${PORT}/health || exit 1
+ CMD ["bun", "-e", "const response = await fetch(`http://localhost:${process.env.PORT || 3456}/health`); process.exit(response.ok ? 0 : 1)"]
CMD ["bun", "run", "src/index.ts"]
diff --git a/apps/media-server/Dockerfile.standalone b/apps/media-server/Dockerfile.standalone
index a99ead35d..105f62f33 100644
--- a/apps/media-server/Dockerfile.standalone
+++ b/apps/media-server/Dockerfile.standalone
@@ -1,11 +1,13 @@
-FROM oven/bun:1-alpine
+FROM oven/bun:1
-RUN apk add --no-cache ffmpeg
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends ffmpeg \
+ && rm -rf /var/lib/apt/lists/*
WORKDIR /app
-COPY package.json ./
-RUN bun install --production
+COPY package.json bun.lock ./
+RUN bun install --frozen-lockfile --production
COPY src ./src
@@ -13,6 +15,6 @@ ENV PORT=3456
EXPOSE 3456
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
- CMD wget -qO- http://localhost:${PORT}/health || exit 1
+ CMD ["bun", "-e", "const response = await fetch(`http://localhost:${process.env.PORT || 3456}/health`); process.exit(response.ok ? 0 : 1)"]
CMD ["bun", "run", "src/index.ts"]