-
Notifications
You must be signed in to change notification settings - Fork 7
hotbox port #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hotbox port #72
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .git | ||
| .github | ||
| .vscode | ||
| .astro | ||
| dist | ||
| node_modules | ||
| .env* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Build with the repo root as context: docker build . | ||
| # | ||
| # The site is fully static (astro `output: 'static'`): the build renders | ||
| # everything to dist/ and nginx serves it — no runtime env needed. On hotbox, | ||
| # create a GitHub service pointing at this repo (Dockerfile at the root) and | ||
| # set the service's public port to 8080. | ||
|
|
||
| FROM node:22-slim AS builder | ||
| WORKDIR /app | ||
|
|
||
| # Bun is the package manager (bun.lockb); the official binary from the | ||
| # oven/bun image runs fine on the same debian base. | ||
| COPY --from=oven/bun:1 /usr/local/bin/bun /usr/local/bin/bun | ||
|
|
||
| COPY package.json bun.lockb ./ | ||
| RUN bun install --frozen-lockfile | ||
|
|
||
| COPY . . | ||
|
|
||
| # Sentry sourcemap upload self-disables (no auth token set), same as CI. | ||
| ENV ASTRO_TELEMETRY_DISABLED=1 | ||
| RUN bun run build | ||
|
|
||
| FROM nginx:alpine AS runner | ||
| COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
| COPY --from=builder /app/dist /usr/share/nginx/html | ||
| EXPOSE 8080 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,21 @@ | ||||||||||||||||||||
| server { | ||||||||||||||||||||
| listen 8080; | ||||||||||||||||||||
| root /usr/share/nginx/html; | ||||||||||||||||||||
| index index.html; | ||||||||||||||||||||
|
Comment on lines
+1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||||||||
|
|
||||||||||||||||||||
| gzip on; | ||||||||||||||||||||
| gzip_types text/css application/javascript application/json image/svg+xml text/plain; | ||||||||||||||||||||
|
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| # Astro emits content-hashed assets under /_astro/ — safe to cache forever. | ||||||||||||||||||||
| location /_astro/ { | ||||||||||||||||||||
| add_header Cache-Control "public, max-age=31536000, immutable"; | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Starlight generates a 404.html page. | ||||||||||||||||||||
| error_page 404 /404.html; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| location / { | ||||||||||||||||||||
| # Pages are built in 'directory' format: <path>/index.html | ||||||||||||||||||||
| try_files $uri $uri/index.html $uri/ =404; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SITE_URLis nowhttps://docs.efp.rip/in the sharedastro.config.ts. Becauseoutput: 'static', every build — including the CI job inchecks.ymlthat presumably still deploys todocs.efp.app— will emit canonical<link>tags, sitemap entries,og:image, andtwitter:imagemetadata pointing atdocs.efp.rip. Any page served fromdocs.efp.appwill tell search engines its canonical URL is on a different domain, which is a direct SEO regression for the existing deployment.The standard fix is to read the URL from an environment variable with the current domain as the fallback:
const SITE_URL = process.env.SITE_URL ?? 'https://docs.efp.app/', then setSITE_URL=https://docs.efp.rip/in the hotbox service environment. That way each deployment gets its own canonical base without touching shared config.