Deployment
Rex produces a single binary and a build output directory. Deploy it anywhere you can run a container or a Linux binary.
Docker
Rex includes a Dockerfile in every project. Build and run locally:
docker build -t my-app .
docker run -p 3000:3000 my-appExample Dockerfile
FROM ghcr.io/limlabs/rex:latest AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN rex build
FROM ghcr.io/limlabs/rex:latest
WORKDIR /app
COPY --from=builder /app/.rex .rex
COPY --from=builder /app/public public
CMD ["rex", "start"]Docker Compose
version: "3.8"
services:
web:
build: .
ports:
- "3000:3000"
environment:
- PORT=3000Cloud platforms
Rex works with any platform that supports Docker containers.
Railway
Deploy directly from a GitHub repo — Railway auto-detects the Dockerfile:
- Connect your repo on Railway
- Railway builds the Docker image and deploys
- Set the
PORTenvironment variable if needed (Railway provides it automatically)
Fly.io
fly launch
fly deployFly detects the Dockerfile. Add a fly.toml to configure regions and scaling:
[http_service]
internal_port = 3000
force_https = trueAWS App Runner
- Push your image to ECR
- Create an App Runner service pointing to the image
- Set the port to 3000
Google Cloud Run
gcloud run deploy my-app \
--source . \
--port 3000 \
--allow-unauthenticatedCloud Run builds from the Dockerfile and deploys a serverless container.
Azure Container Apps
az containerapp up \
--name my-app \
--source . \
--ingress external \
--target-port 3000DigitalOcean App Platform
- Connect your GitHub repo
- Select "Dockerfile" as the build method
- Set the HTTP port to 3000
Production readiness
Before deploying to production, verify:
- Visual correctness — review every page and interactive element in a staging environment
- Functional testing — test forms, navigation, data fetching, and error states
- Security — audit dependencies, validate user input, configure HTTPS and security headers
- Performance — run load tests to understand throughput and latency under expected traffic
- Monitoring — set up logging, error tracking, and health checks
- Environment variables — ensure secrets are stored securely and not committed to source control