Skip to content

Commit 6cba91d

Browse files
authored
fix: restore resilient Farside ETF flows (#28)
1 parent e8a700a commit 6cba91d

6 files changed

Lines changed: 825 additions & 778 deletions

File tree

.trunk/trunk.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ lint:
2525
- markdownlint@0.47.0
2626
- git-diff-check
2727
ignore:
28+
# bun.lock contains package integrity hashes, not prose; codespell can
29+
# misidentify checksum fragments as words.
30+
- linters: [codespell]
31+
paths:
32+
- bun.lock
2833
- linters: [ALL]
2934
paths:
3035
- node_modules/**

Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@ FROM oven/bun:1.3.9-slim@sha256:8ca06c7812d9050ccc4b80799685f395d6a0d051d3b7207d
33

44
WORKDIR /app
55

6+
# Puppeteer downloads Chrome during `bun install`. Keep it in the application
7+
# directory so the non-root runtime user can find and execute it.
8+
ENV PUPPETEER_CACHE_DIR=/app/.cache/puppeteer
9+
10+
# Chrome's shared-library and font dependencies. The process still runs as the
11+
# unprivileged `bun` user below; Cloud Run provides the outer sandbox.
12+
RUN apt-get update \
13+
&& apt-get install --yes --no-install-recommends \
14+
ca-certificates \
15+
fonts-liberation \
16+
libasound2 \
17+
libatk-bridge2.0-0 \
18+
libatk1.0-0 \
19+
libcups2 \
20+
libdbus-1-3 \
21+
libgbm1 \
22+
libgtk-3-0 \
23+
libnspr4 \
24+
libnss3 \
25+
libx11-xcb1 \
26+
libxcomposite1 \
27+
libxdamage1 \
28+
libxfixes3 \
29+
libxrandr2 \
30+
xdg-utils \
31+
&& rm -rf /var/lib/apt/lists/*
32+
633
# Install dependencies (with BuildKit cache mount for faster rebuilds)
734
COPY package.json bun.lock ./
835
COPY patches ./patches
@@ -13,6 +40,11 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
1340
COPY src ./src
1441
COPY tsconfig.json ./
1542

43+
# `bun install` runs as root during the image build, while Cloud Run executes
44+
# the service as `bun`. Hand the downloaded browser and source tree over before
45+
# dropping privileges.
46+
RUN chown -R bun:bun /app
47+
1648
# Production defaults
1749
ENV NODE_ENV=production
1850
ENV PORT=8080

0 commit comments

Comments
 (0)