Something went wrong. Try again.
The Cavu Reader
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445# Build context is the REPO ROOT, not reader/: the @lexicons/* alias# resolves to ../src/lexicons — generated types shared with the repo's# scripts, whose own imports (@atproto/lexicon, multiformats) resolve# against the ROOT package.json's node_modules. The image mirrors that# layout: root deps at /repo, app at /repo/reader. Deploy from reader/:# fly deploy .. --config $PWD/fly.toml --dockerfile $PWD/DockerfileFROM node:24-slim AS buildRUN npm install -g pnpm@10WORKDIR /repoCOPY package.json pnpm-lock.yaml ./RUN pnpm install --frozen-lockfileCOPY src/lexicons ./src/lexiconsCOPY src/lexiconRuntime.ts ./src/lexiconRuntime.tsWORKDIR /repo/readerCOPY reader/package.json reader/pnpm-lock.yaml ./RUN pnpm install --frozen-lockfileCOPY reader/ ./# Client-bundle constants: CDN base for image URLs, root URL for the# "hosted here" predicate, feedback surface URLs (fly.toml [build.args]).ARG VITE_CDN_BASE_URLARG VITE_READER_ROOT_URLARG VITE_FEEDBACK_SPACE_URLARG VITE_ATSTORE_REVIEW_URLENV VITE_CDN_BASE_URL=$VITE_CDN_BASE_URL VITE_READER_ROOT_URL=$VITE_READER_ROOT_URL \ VITE_FEEDBACK_SPACE_URL=$VITE_FEEDBACK_SPACE_URL VITE_ATSTORE_REVIEW_URL=$VITE_ATSTORE_REVIEW_URLRUN pnpm build
FROM node:24-slimWORKDIR /appENV NODE_ENV=productionRUN npm install -g pnpm@10# Litestream streams the SQLite file to a private Tigris bucket and# restores it onto a fresh volume at boot (see start.sh, litestream.yml).ARG TARGETARCHADD https://github.com/benbjohnson/litestream/releases/download/v0.3.13/litestream-v0.3.13-linux-${TARGETARCH}.deb /tmp/litestream.debRUN dpkg -i /tmp/litestream.deb && rm /tmp/litestream.debCOPY reader/package.json reader/pnpm-lock.yaml ./RUN pnpm install --frozen-lockfile --prodCOPY --from=build /repo/reader/dist ./distCOPY reader/litestream.yml /etc/litestream.ymlCOPY reader/server.mjs reader/start.sh ./RUN chmod +x start.shEXPOSE 3000CMD ["./start.sh"]