Deployment
Linkblog is designed to run on AWS App Runner via Docker. This page covers building the image, configuring the environment, and deploying.
Docker
Dockerfile (planned)
A multi-stage build keeps the production image small:
# Stage 1: Build
FROM node:20-alpine AS build
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN corepack enable && pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
# Stage 2: Production
FROM node:20-alpine
WORKDIR /app
COPY --from=build /app/dist ./dist
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/package.json ./
EXPOSE 3000
CMD ["node", "dist/main"]
.dockerignore
node_modules
.git
.env
dist
coverage
docs
supabase/.temp
Build and Run Locally
docker build -t linkblog .
docker run -p 3000:3000 \
-e SUPABASE_URL=https://your-project.supabase.co \
-e SUPABASE_ANON_KEY=your-anon-key \
-e API_KEY=your-api-key \
linkblog
AWS App Runner
Environment Variables
Configure these in the App Runner service settings:
| Variable | Description |
|---|---|
SUPABASE_URL |
Supabase project URL |
SUPABASE_ANON_KEY |
Supabase anonymous key |
API_KEY |
Secret key for write endpoints |
PORT |
App Runner sets this automatically |
Health Check
App Runner uses GET /health to determine if the service is healthy. The endpoint returns 200 OK with no authentication required.
Configure the health check in App Runner:
- Path:
/health - Protocol: HTTP
- Interval: 10 seconds
- Timeout: 5 seconds
- Healthy threshold: 1
- Unhealthy threshold: 3
Deployment Steps
- Push image to ECR (or connect App Runner to your GitHub repo for source-based deploys)
- Create App Runner service with the container image
- Set environment variables in the service configuration
- Configure health check to use
/health - App Runner assigns a public URL — use that or configure a custom domain
Custom Domain
To use a custom domain with App Runner:
- Go to the App Runner service in the AWS console
- Under Custom domains, add your domain
- Create the DNS records (CNAME) as instructed
- Wait for certificate validation
CI/CD (planned)
A GitHub Actions workflow can automate deployment:
- On push to
main:- Run tests
- Build Docker image
- Push to ECR
- Trigger App Runner deployment
Next: Implementation Plan