fix(deploy): fix Caddyfile syntax, node permissions, web node_modules

Author: Aaron Steven White
Commit 036e6dd6ad0393fc415b09ba96d194506453e9b3
Parent: a7258f9a2c
Structural diff unavailable

These commits were pushed via plain git push, so no pre-parsed schemas are available. Install git-remote-cospan and re-push via panproto:// to see scope-level changes, breaking change detection, and semantic diffs.

brew install panproto/tap/git-remote-cospan
4 files changed +8 -18
@@ -1,20 +1,11 @@
1-{$DOMAIN} {
2-	# Frontend (SvelteKit)
1+{$DOMAIN:cospan.dev} {
32 	reverse_proxy web:3000
43 
5-	# AppView XRPC + OAuth (proxied through SvelteKit catch-all routes)
6-	# Direct XRPC access for external clients
74 	handle /xrpc/* {
85 		reverse_proxy appview:3000
96 	}
107 }
118 
12-node.{$DOMAIN} {
13-	# Node XRPC
14-	reverse_proxy /xrpc/* node:3001
15-
16-	# Git smart HTTP
17-	reverse_proxy /*/info/refs node:3001
18-	reverse_proxy /*/git-upload-pack node:3001
19-	reverse_proxy /*/git-receive-pack node:3001
9+node.{$DOMAIN:cospan.dev} {
10+	reverse_proxy node:3001
2011 }
@@ -5,10 +5,7 @@ WORKDIR /app
55 
66 RUN corepack enable
77 
8-# Copy workspace root files
98 COPY package.json pnpm-workspace.yaml ./
10-
11-# Copy the web app and shared packages
129 COPY apps/web/ apps/web/
1310 COPY packages/ packages/
1411 
@@ -20,6 +17,7 @@ FROM node:22-slim
2017 
2118 WORKDIR /app
2219 
20+# Copy the built output and all node_modules (SvelteKit needs them at runtime)
2321 COPY --from=builder /app/apps/web/build ./build
2422 COPY --from=builder /app/apps/web/package.json .
2523 COPY --from=builder /app/apps/web/node_modules ./node_modules
@@ -1,17 +1,14 @@
11 # Stage 1: Build
22 FROM rust:1.88-bookworm AS builder
33 
4-# Install build dependencies for tree-sitter grammars (C/C++ compilers)
54 RUN apt-get update && apt-get install -y cmake g++ pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
65 
76 WORKDIR /app
87 
9-# Copy workspace files
108 COPY Cargo.toml Cargo.lock ./
119 COPY crates/ crates/
1210 COPY packages/ packages/
1311 
14-# Build the cospan-node binary
1512 RUN cargo build --release -p cospan-node
1613 
1714 # Stage 2: Runtime
@@ -21,6 +18,8 @@ RUN apt-get update && apt-get install -y ca-certificates libssl3 && rm -rf /var/
2118 
2219 COPY --from=builder /app/target/release/cospan-node /usr/local/bin/
2320 
21+RUN mkdir -p /data && chown 1001:1001 /data
22+
2423 USER 1001
2524 
2625 EXPOSE 3001
@@ -15,6 +15,8 @@ services:
1515     ports:
1616       - "80:80"
1717       - "443:443"
18+    environment:
19+      DOMAIN: ${DOMAIN:?DOMAIN is required}
1820     volumes:
1921       - ./Caddyfile.prod:/etc/caddy/Caddyfile:ro
2022       - caddy-data:/data
cospan · schematic version control on atproto built on AT Protocol