Social Annotations in the Atmosphere
15
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add Dockerfile-based proxy build for Fly.io remote builds

- Add Dockerfile.proxy for multi-stage builds
- Update fly.proxy.toml for remote builder
- Update Caddyfile config
- Remove unused netlify.toml

+98 -9
+6
Caddyfile
··· 22 22 redir https://seams.so 23 23 } 24 24 25 + # Serve .well-known for TWA (Digital Asset Links) 26 + handle /.well-known/* { 27 + root * proxy/static 28 + file_server 29 + } 30 + 25 31 # OAuth callback rewrite 26 32 handle /oauth/callback { 27 33 root * proxy/static
+86
Dockerfile.proxy
··· 1 + # Build stage - compile via client with Node 2 + FROM node:20-alpine AS builder 3 + 4 + RUN apk add --no-cache bash 5 + RUN npm install -g pnpm 6 + 7 + WORKDIR /build 8 + COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ 9 + COPY packages/ ./packages/ 10 + COPY entrypoints/via-client/ ./entrypoints/via-client/ 11 + COPY entrypoints/sidepanel/ ./entrypoints/sidepanel/ 12 + COPY proxy/via-html/ ./proxy/via-html/ 13 + COPY landing/landing.css landing/fonts.css landing/favicon.ico ./landing/ 14 + COPY landing/fonts/ ./landing/fonts/ 15 + COPY landing/oauth/client-metadata.json ./landing/oauth/ 16 + COPY vite.via.config.ts tsconfig.json ./ 17 + COPY scripts/postbuild-via.sh ./scripts/ 18 + 19 + RUN pnpm install --frozen-lockfile 20 + RUN BACKEND_URL=https://seams.so pnpm build:via 21 + 22 + # Runtime stage 23 + FROM python:3.11-slim 24 + 25 + # Install system dependencies 26 + RUN apt-get update && apt-get install -y --no-install-recommends \ 27 + curl \ 28 + ca-certificates \ 29 + && rm -rf /var/lib/apt/lists/* 30 + 31 + # Install uv 32 + RUN curl -LsSf https://astral.sh/uv/install.sh | sh 33 + ENV PATH="/root/.local/bin:$PATH" 34 + 35 + # Install Caddy 36 + RUN curl -L "https://caddyserver.com/api/download?os=linux&arch=amd64" -o /usr/local/bin/caddy \ 37 + && chmod +x /usr/local/bin/caddy 38 + 39 + WORKDIR /app 40 + 41 + # Copy proxy config and collections 42 + COPY proxy/config.yaml ./proxy/ 43 + COPY proxy/collections/ ./proxy/collections/ 44 + 45 + # Copy built static files from builder 46 + COPY --from=builder /build/proxy/static/ ./proxy/static/ 47 + 48 + # Copy Caddyfile 49 + COPY Caddyfile ./ 50 + 51 + # Create startup script 52 + RUN cat <<'EOF' > /app/start.sh 53 + #!/bin/bash 54 + set -e 55 + 56 + echo "🚀 Starting Seams Proxy..." 57 + 58 + # Install pywb at runtime using uv (like flake.nix does) 59 + echo "📦 Installing pywb..." 60 + export UV_CACHE_DIR=/root/.cache/uv 61 + export UV_TOOL_BIN_DIR=/root/.local/bin 62 + uv tool install pywb --with setuptools 63 + 64 + # Add local bin to PATH 65 + export PATH=$PATH:/root/.local/bin 66 + 67 + # Start wayback (pywb) on port 8081 68 + cd /app/proxy 69 + echo "📦 Starting wayback on :8081" 70 + wayback -p 8081 -b 127.0.0.1 & 71 + WB_PID=$! 72 + 73 + # Wait for wayback to initialize 74 + sleep 2 75 + 76 + # Start Caddy on port 8082 77 + cd /app 78 + echo "🌐 Starting Caddy on :8082" 79 + caddy run --config /app/Caddyfile --adapter caddyfile 80 + EOF 81 + 82 + RUN chmod +x /app/start.sh 83 + 84 + EXPOSE 8082 85 + 86 + CMD ["/app/start.sh"]
+3 -1
flake.nix
··· 91 91 pkgs.stdenv.cc.cc.lib # For pywb/gevent dependencies 92 92 93 93 # Config and static files 94 - # Note: This relies on proxy/static being populated by 'pnpm build:via' locally 94 + # Note: This relies on proxy/static being populated by running: 95 + # BACKEND_URL=https://seams.so pnpm build:via 96 + # locally before building. The BACKEND_URL must be set for production! 95 97 # and included in the source tree (e.g. git tracked or added). 96 98 (pkgs.runCommand "proxy-files" {} '' 97 99 mkdir -p $out/app/proxy
+3
fly.proxy.toml
··· 2 2 app = 'sure-seams-so' 3 3 primary_region = 'sjc' 4 4 5 + [build] 6 + dockerfile = "Dockerfile.proxy" 7 + 5 8 [http_service] 6 9 internal_port = 8082 7 10 force_https = true
-8
netlify.toml
··· 1 - [build] 2 - publish = "public" 3 - command = "echo 'No build needed'" 4 - 5 - [[redirects]] 6 - from = "/oauth-client-metadata.json" 7 - to = "/oauth/client-metadata.json" 8 - status = 200