A lightweight development proxy service for API debugging and testing. Route requests through proxy, cache, redirect, blob, and subscribe handlers.
1. Run database migration:
docker run --rm \
-v ./data:/app/data \
portals-next:migrate-latest
2. Start application:
docker run -d \
-p 3000:3000 \
-v ./data:/app/data \
-e AUTH_SECRET="your-secret-key-here" \
--name portals-next \
portals-next
# Download docker-compose.yml and .env.example
curl -O https://raw.githubusercontent.com/your-repo/portals-next/main/docker-compose/deploy/docker-compose.yml
curl -O https://raw.githubusercontent.com/your-repo/portals-next/main/docker-compose/deploy/.env.example
# Configure environment
cp .env.example .env
# Edit .env and set AUTH_SECRET
# Start services (migration runs automatically)
docker-compose up -d
| Type | Shortcut | Description |
|---|---|---|
proxy | p | Forward requests to target URL |
redirect | r | HTTP redirects (301/302/307/308) |
cache | c | Cached proxy with Redis (requires Redis) |
blob | b | Serve stored text content |
subscribe | s | Composed subscription URLs |
URL format: /<shortcut>/<pathname>
| Variable | Description | Example |
|---|---|---|
AUTH_SECRET | Secret key for authentication | Generate with command below |
Generate AUTH_SECRET:
openssl rand -base64 32
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_BASE_PATH | Base path for the application | / |
AUTH_TRUSTED_ORIGINS | Trusted origins (comma-separated) | * |
Redis is only required if you plan to use cache routes. All other route types (proxy, redirect, blob, subscribe) work without Redis.
| Variable | Description | Default |
|---|---|---|
REDIS_HOST | Redis server hostname | 127.0.0.1 |
REDIS_PORT | Redis server port | 6379 |
REDIS_PASSWORD | Redis authentication password | - |
REDIS_DB | Redis database number | 0 |
# Build application image
docker build -t portals-next .
# Build migration image
docker build -f Dockerfile.migrate -t portals-next:migrate-latest .
Run migration before starting the application:
docker run --rm \
-v ./data:/app/data \
portals-next:migrate-latest
docker run -d \
-p 3000:3000 \
-v ./data:/app/data \
-e AUTH_SECRET="your-secret-key-here" \
-e REDIS_HOST="redis-server" \
-e REDIS_PORT="6379" \
--name portals-next \
portals-next
docker run -d \
-p 3000:3000 \
-v ./data:/app/data \
-e AUTH_SECRET="your-secret-key-here" \
-e REDIS_HOST="your-redis-host" \
-e REDIS_PORT="6379" \
-e REDIS_PASSWORD="your-redis-password" \
--name portals-next \
portals-next
Create docker-compose.yml:
name: portals
services:
redis:
image: redis:7-alpine
command: redis-server --save 60 1000 --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 5
restart: always
networks:
- portals-network
migrate:
image: portals-next:migrate-latest
volumes:
- './data:/app/data'
restart: "no"
networks:
- portals-network
portals:
image: portals-next
ports:
- '${PORTALS_PORT:-3000}:3000'
depends_on:
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
volumes:
- './data:/app/data'
env_file:
- .env
restart: always
networks:
- portals-network
volumes:
redis_data:
driver: local
networks:
portals-network:
driver: bridge
Create .env:
AUTH_SECRET="your-secret-key-here"
REDIS_HOST="redis"
REDIS_PORT="6379"
PORTALS_PORT=3000
Start services:
docker-compose up -d
Manual migration:
docker-compose run --rm migrate
services:
portals:
image: portals-next
ports:
- '3000:3000'
volumes:
- './data:/app/data'
environment:
- AUTH_SECRET=your-secret-key-here
- REDIS_HOST=your-redis-host
- REDIS_PORT=6379
- REDIS_PASSWORD=your-redis-password
restart: always
The application stores SQLite database in /app/data:
# Mount volume for data persistence
-v ./data:/app/data
apiVersion: apps/v1
kind: Deployment
metadata:
name: portals-next
spec:
template:
spec:
initContainers:
- name: migrate
image: ghcr.io/your-org/portals-next:migrate-latest
volumeMounts:
- name: data
mountPath: /app/data
containers:
- name: app
image: ghcr.io/your-org/portals-next:latest
ports:
- containerPort: 3000
env:
- name: AUTH_SECRET
valueFrom:
secretKeyRef:
name: portals-secrets
key: auth-secret
volumeMounts:
- name: data
mountPath: /app/data
volumes:
- name: data
persistentVolumeClaim:
claimName: portals-data
For more control, use a separate Job for migration before deploying the application:
# Run migration job
kubectl create job portals-migrate --image=portals-next:migrate-latest
kubectl wait --for=condition=complete job/portals-migrate
# Deploy application
kubectl apply -f deployment.yaml
http://localhost:3000/sign-in to access admin dashboard/sign-up to create the first account# Liveness probe
curl http://localhost:3000/api/health/live
# Readiness probe
curl http://localhost:3000/api/health/ready
MIT
Content type
Image
Digest
sha256:221b818f6…
Size
103.3 MB
Last updated
2 months ago
docker pull larify/portals-next