Production Deployment

ZKAuth Deployment

Deploy ZKAuth to production with confidence. Choose your preferred deployment strategy.

Deployment Options

Choose the deployment strategy that fits your infrastructure

Cloud Platforms

Deploy to major cloud providers with managed services

AWS

Amazon Web Services

Google Cloud

Google Cloud Platform

Azure

Microsoft Azure

Container Deployment

Deploy using Docker containers for consistency

Docker

Container orchestration

Kubernetes

Container management

Docker Compose

Multi-container apps

Self-Hosted

Deploy on your own infrastructure

VPS

Virtual Private Server

Bare Metal

Physical servers

On-Premises

Your own data center

Docker Deployment

Deploy ZKAuth using Docker containers

Dockerfile

dockerfile
FROM node:18-alpine

WORKDIR /app

COPY package*.json ./
RUN npm ci --only=production

COPY . .

EXPOSE 3000

CMD ["npm", "start"]

Docker Compose

yaml
version: '3.8'

services:
  zkauth:
    build: .
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - DATABASE_URL=postgresql://user:pass@db:5432/zkauth
    depends_on:
      - db
      - redis

  db:
    image: postgres:15
    environment:
      POSTGRES_DB: zkauth
      POSTGRES_USER: user
      POSTGRES_PASSWORD: pass
    volumes:
      - postgres_data:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine
    volumes:
      - redis_data:/data

volumes:
  postgres_data:
  redis_data:

Kubernetes Deployment

Deploy to Kubernetes clusters

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: zkauth
spec:
  replicas: 3
  selector:
    matchLabels:
      app: zkauth
  template:
    metadata:
      labels:
        app: zkauth
    spec:
      containers:
      - name: zkauth
        image: zkauth/app:latest
        ports:
        - containerPort: 3000
        env:
        - name: NODE_ENV
          value: "production"
        - name: DATABASE_URL
          valueFrom:
            secretKeyRef:
              name: zkauth-secrets
              key: database-url
---
apiVersion: v1
kind: Service
metadata:
  name: zkauth-service
spec:
  selector:
    app: zkauth
  ports:
  - port: 80
    targetPort: 3000
  type: LoadBalancer

Environment Configuration

Configure your production environment

Database Setup

Configure PostgreSQL database for production

env
DATABASE_URL=postgresql://user:pass@host:5432/zkauth
DATABASE_SSL=true
DATABASE_POOL_SIZE=20

Redis Configuration

Set up Redis for caching and sessions

env
REDIS_URL=redis://host:6379
REDIS_PASSWORD=your_redis_password
REDIS_DB=0

Security Settings

Configure security for production

env
JWT_SECRET=your_super_secret_jwt_key
CORS_ORIGIN=https://yourdomain.com
RATE_LIMIT_WINDOW=900000
RATE_LIMIT_MAX=100

Monitoring

Set up monitoring and logging

env
LOG_LEVEL=info
METRICS_ENABLED=true
HEALTH_CHECK_ENDPOINT=/health
PROMETHEUS_METRICS=true

Ready to Deploy?

Deploy ZKAuth to production and start securing your applications.