Skip to content

Commit fd03d1d

Browse files
committed
Add Fly.io deploy workflow and Dockerfile
Introduces a Dockerfile and .dockerignore for containerized builds, a Fly.io deployment workflow via GitHub Actions
1 parent 5ba6cff commit fd03d1d

File tree

8 files changed

+342
-12
lines changed

8 files changed

+342
-12
lines changed

.dockerignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
node_modules/
2+
dist/
3+
*.tsbuildinfo
4+
.DS_Store
5+
.vercel
6+
.netlify
7+
_site/
8+
.astro/
9+
scripts/smoke/*-main/
10+
scripts/memory/project/src/pages/
11+
benchmark/projects/
12+
benchmark/results/
13+
test-results/
14+
*.log
15+
package-lock.json
16+
.turbo/
17+
.eslintcache
18+
.pnpm-store
19+
.vscode-test/
20+
21+
# do not commit .env files or any files that end with `.env`
22+
*.env
23+
24+
packages/astro/src/**/*.prebuilt.ts
25+
packages/astro/src/**/*.prebuilt-dev.ts
26+
packages/astro/test/units/_temp-fixtures/*
27+
!packages/astro/test/units/_temp-fixtures/package.json
28+
packages/integrations/**/.netlify/
29+
30+
# exclude IntelliJ/WebStorm stuff
31+
.idea
32+
33+
# ignore content collection generated files
34+
packages/**/test/**/fixtures/**/.astro/
35+
packages/**/test/**/fixtures/**/env.d.ts
36+
packages/**/e2e/**/fixtures/**/.astro/
37+
packages/**/e2e/**/fixtures/**/env.d.ts
38+
examples/**/.astro/
39+
examples/**/env.d.ts
40+
41+
# make it easy for people to add project-specific Astro settings that they don't
42+
# want to share with others (see
43+
# https://github.com/withastro/astro/pull/11759#discussion_r1721444711)
44+
*.code-workspace

.github/workflows/fly-deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2+
3+
name: Fly Deploy
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group # optional: ensure only one action runs at a time
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: superfly/flyctl-actions/setup-flyctl@master
16+
- run: flyctl deploy --remote-only
17+
env:
18+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

.gitignore

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
11
node_modules/
2-
.vitepress/dist/
3-
.vitepress/cache/
2+
dist/
3+
*.tsbuildinfo
4+
.DS_Store
5+
.vercel
6+
.netlify
7+
_site/
8+
.astro/
9+
scripts/smoke/*-main/
10+
scripts/memory/project/src/pages/
11+
benchmark/projects/
12+
benchmark/results/
13+
test-results/
14+
*.log
15+
package-lock.json
16+
.turbo/
17+
.eslintcache
18+
.pnpm-store
19+
.vscode-test/
20+
21+
# do not commit .env files or any files that end with `.env`
22+
*.env
23+
24+
packages/astro/src/**/*.prebuilt.ts
25+
packages/astro/src/**/*.prebuilt-dev.ts
26+
packages/astro/test/units/_temp-fixtures/*
27+
!packages/astro/test/units/_temp-fixtures/package.json
28+
packages/integrations/**/.netlify/
29+
30+
# exclude IntelliJ/WebStorm stuff
31+
.idea
32+
33+
# ignore content collection generated files
34+
packages/**/test/**/fixtures/**/.astro/
35+
packages/**/test/**/fixtures/**/env.d.ts
36+
packages/**/e2e/**/fixtures/**/.astro/
37+
packages/**/e2e/**/fixtures/**/env.d.ts
38+
examples/**/.astro/
39+
examples/**/env.d.ts
40+
41+
# make it easy for people to add project-specific Astro settings that they don't
42+
# want to share with others (see
43+
# https://github.com/withastro/astro/pull/11759#discussion_r1721444711)
44+
*.code-workspace

CLAUDE.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Sprites documentation site built with Astro Starlight and React components. Static site deployed to Fly.io via Docker/nginx.
8+
9+
## Commands
10+
11+
```bash
12+
bun install # Install dependencies
13+
bun run dev # Start dev server at localhost:4321
14+
bun run build # Build static site to ./dist/
15+
bun run preview # Preview production build locally
16+
```
17+
18+
## Architecture
19+
20+
### Tech Stack
21+
- **Framework**: Astro 5 with Starlight documentation theme
22+
- **Styling**: Tailwind CSS v4 with shadcn/ui components (OKLCH color space)
23+
- **Interactive**: React 19 islands with Radix UI primitives
24+
- **Fonts**: Self-hosted Inter (body) and JetBrains Mono (headings/code)
25+
26+
### Project Structure
27+
- `src/content/docs/` - MDX documentation pages (routes based on filename)
28+
- `src/components/react/` - React island components for interactive elements
29+
- `src/components/ui/` - shadcn/ui base components (Radix-based)
30+
- `src/components/*.astro` - Astro wrapper components for React islands
31+
- `src/styles/custom.css` - Theme customization (Starlight + shadcn variables)
32+
- `astro.config.mjs` - Site config including sidebar structure
33+
34+
### Component Pattern
35+
React components are wrapped in `.astro` files for MDX usage. The React components export from `src/components/react/index.ts`:
36+
- `CodeTabs`/`Snippet` - Language-tabbed code blocks
37+
- `Callout` - Alert/info boxes
38+
- `ParamTable`/`Param` - API parameter documentation
39+
- `APIEndpoint`/`StatusCodes` - REST API documentation
40+
- `BillingCalculator`/`PricingRates` - Interactive pricing tools
41+
42+
Use `client:load` directive when importing React components in MDX.
43+
44+
### Path Aliases
45+
- `@/*``./src/*`
46+
- `@components/*``./src/components/*`
47+
48+
## Styling Notes
49+
50+
- Theme uses sharp corners (`--radius: 0`, `--sl-border-radius: 0`)
51+
- Dark mode is default; light mode uses violet accent (hue 285), dark uses teal/green (hue ~131)
52+
- Tailwind v4 custom variant: `@custom-variant dark (&:is(.dark *, [data-theme="dark"] *))`

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# syntax = docker/dockerfile:1
2+
3+
ARG BUN_VERSION=1.3.2
4+
FROM oven/bun:${BUN_VERSION}-slim AS build
5+
6+
WORKDIR /app
7+
ENV NODE_ENV="production"
8+
9+
# Install packages needed for sharp native module
10+
RUN apt-get update -qq && \
11+
apt-get install --no-install-recommends -y build-essential pkg-config python-is-python3 && \
12+
rm -rf /var/lib/apt/lists/*
13+
14+
# Install dependencies
15+
COPY bun.lock package.json ./
16+
RUN bun install --frozen-lockfile
17+
18+
# Copy and build
19+
COPY . .
20+
RUN bun run build
21+
22+
# Final stage - minimal nginx
23+
FROM nginx:alpine
24+
25+
# SPA routing + caching for static assets
26+
RUN printf 'server {\n\
27+
listen 80;\n\
28+
root /usr/share/nginx/html;\n\
29+
location / {\n\
30+
try_files $uri $uri/ $uri.html /index.html;\n\
31+
}\n\
32+
location ~* \\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {\n\
33+
expires 1y;\n\
34+
add_header Cache-Control "public, immutable";\n\
35+
}\n\
36+
}' > /etc/nginx/conf.d/default.conf
37+
38+
COPY --from=build /app/dist /usr/share/nginx/html
39+
40+
EXPOSE 80
41+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)