Repository navigation
Expand file tree
/
Copy pathDockerfile.dev
More file actions
36 lines (28 loc) · 1.76 KB
/
Copy pathDockerfile.dev
File metadata and controls
36 lines (28 loc) · 1.76 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
35
36
# syntax=ghcr.io/k2b-dev/mirror/docker/dockerfile:1.7-labs@sha256:b99fecfe00268a8b556fad7d9c37ee25d716ae08a5d7320e6d51c4dd83246894
FROM ghcr.io/k2b-dev/mirror/oven/bun:1.4.4@sha256:1d22548f177f4ff38e0c15baa3c2c46c6c2060ba2d1bc573bb4720b407548f1d
WORKDIR /app
# 1. Copy only package.json files first so the install layer is cached
# independently of source changes.
COPY package.json bun.lock bunfig.toml ./
COPY patches/ patches/
COPY --parents packages/*/package.json pwas/*/package.json fixtures/*/package.json docs-site/package.json ./
COPY tsconfig.base.json ./
# --ignore-scripts: skip postinstall hooks. The base image already
# ships bun, but `bun-plugin-tailwind` declares `bun >=1.0.0` as a peer dep, so
# Bun's installer pulls the npm `bun` package into the lockfile. Its postinstall
# tries to extract the platform-specific binary (@oven/bun-linux-*) and fails
# inside the build sandbox. We don't need any postinstalls here — services that
# need native deps (filegate → sharp/libvips) run in their own pre-built images.
RUN bun install --frozen-lockfile --ignore-scripts
# Only Assistant needs the independent, server-owned code execution browser.
ARG INSTALL_CHROMIUM=false
RUN if [ "$INSTALL_CHROMIUM" = "true" ]; then apt-get update && apt-get install -y --no-install-recommends chromium && rm -rf /var/lib/apt/lists/*; fi
# 2. Source comes after install. Volume mounts in compose.dev.yml overlay
# live source on top of these defaults at runtime.
COPY packages/ packages/
COPY styles.css ./
RUN bun run --cwd packages/ui build
# Dev build output (CSS under public/, island chunks under _ssr/) is written at
# runtime; keep it writable for services that run as `bun` (Assistant).
RUN mkdir -p /app/public /app/_ssr && chown bun:bun /app/public /app/_ssr
EXPOSE 3000