CI now builds the API and website images after the tests, pushes them to git.t5de.dev, and deploys them through Komodo (.gitea/scripts/deploy.py): pushes to main as :main to hub.staging.t5de.dev, vX.Y.Z tags as :X.Y.Z to hub.t5de.dev, with the version pinned in t5de/t5de-infra. The API image installs with --linker hoisted: Bun's isolated layout keeps the workspace links (@t5de/db) in each package's own node_modules, which the image didn't copy, so the API couldn't start. Co-Authored-By: Claude Opus 5.5 <[email protected]>
21 lines
771 B
Docker
21 lines
771 B
Docker
# The hub's API. Build from the repository root: docker build -f apps/api/Dockerfile .
|
|
FROM oven/bun:1.4.4-slim AS deps
|
|
WORKDIR /app
|
|
COPY package.json bun.lock ./
|
|
COPY apps/api/package.json apps/api/
|
|
COPY apps/web/package.json apps/web/
|
|
COPY packages/db/package.json packages/db/
|
|
# Hoisted, so everything (the workspace packages too) is in the node_modules copied below; Bun's default isolated
|
|
# layout keeps links in each package's own node_modules.
|
|
RUN bun install --frozen-lockfile --production --filter @t5de/api --linker hoisted
|
|
|
|
FROM oven/bun:1.4.4-slim
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production PORT=4101
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY packages/db ./packages/db
|
|
COPY apps/api ./apps/api
|
|
USER bun
|
|
EXPOSE 4101
|
|
CMD ["bun", "apps/api/src/index.ts"]
|