Pytigon can be deployed in containers using Docker or Podman for consistent, portable environments.
FROM python:3.12-slim
RUN apt-get update && apt-get install -y \
build-essential \
libxml2-dev libxslt1-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["pytigon", "run", "--host", "0.0.0.0", "--port", "8000"]
version: '3.8'
services:
pytigon:
build: .
ports:
- "8000:8000"
volumes:
- ./data:/app/data
- ./projects:/app/prj
environment:
- DJANGO_SETTINGS_MODULE=your_project.settings
- DATABASE_URL=postgres://user:pass@db:5432/pytigon
depends_on:
- db
- redis
db:
image: postgres:16
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: pytigon
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:7-alpine
volumes:
pgdata:
# Build image
podman build -t pytigon .
# Run with podman-compose
podman-compose up -d
# Or run standalone
podman run -d \
-p 8000:8000 \
-v ./data:/app/data \
-e DATABASE_URL=postgres://user:pass@host:5432/pytigon \
pytigon
| Environment Variable | Description |
|---|---|
DJANGO_SETTINGS_MODULE |
Django settings module path |
DATABASE_URL |
Database connection string |
REDIS_URL |
Redis connection for Channels/cache |
SECRET_KEY |
Django secret key |
ALLOWED_HOSTS |
Comma-separated allowed hosts |
DATA_PATH |
Persistent data directory |
Pytigon can be deployed to Kubernetes using standard Django deployment patterns:
apiVersion: apps/v1
kind: Deployment
metadata:
name: pytigon
spec:
replicas: 3
selector:
matchLabels:
app: pytigon
template:
metadata:
labels:
app: pytigon
spec:
containers:
- name: pytigon
image: your-registry/pytigon:latest
ports:
- containerPort: 8000
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: pytigon-secrets
key: database-url
Critical directories to mount as volumes:
- /app/data — User data and application files
- /app/prj — Project source code and applications
- /app/static — Static files (can be served by CDN/nginx)
For production deployments, serve static files through a reverse proxy (nginx, Traefik) and use a dedicated database and Redis instance.