Docker image and orchestration for Sixpack A/B testing service.
This project provides:
- Dockerfile: Multi-purpose image for Sixpack API and Web (Python 2.7.18, pinned dependencies, Gunicorn).
- Docker Compose: Local stack with Sixpack API, Sixpack Web, and Redis.
- Kubernetes: Deployment and service manifests for API and Web under
kube/.
- Docker and Docker Compose (Compose V2)
- For Kubernetes:
kubectland cluster access
Build and start all services (API, Web, Redis):
docker compose up --build- Sixpack API: http://localhost:5000
- Sixpack Web: http://localhost:5001
- Redis: internal only (port 6379)
Run in detached mode (background):
docker compose up --build -dStop and remove containers, networks, and optionally volumes:
docker compose downTo also remove volumes (e.g. Redis data):
docker compose down -v- View logs:
docker compose logs -f - Restart a service:
docker compose restart sixpackapiordocker compose restart sixpackweb - Rebuild after Dockerfile changes:
docker compose up --build
- Base:
python:2.7.18 - Sixpack: 2.0.2, installed with
--no-deps; dependencies are pinned to avoid pulling yuicompressor from PyPI. - Server: Gunicorn 19.3.0 with gevent workers (default CMD).
- Commands:
sixpack(API) andsixpack-web(Web) are used in Compose and Kubernetes.
| Variable | Description |
|---|---|
SIXPACK_CONFIG_ENABLED |
Enable Sixpack (e.g. true) |
SIXPACK_CONFIG_REDIS_HOST |
Redis host (e.g. redis in Compose) |
SIXPACK_CONFIG_REDIS_PORT |
Redis port (default 6379) |
SIXPACK_CONFIG_REDIS_PREFIX |
Redis key prefix (e.g. sixpack) |
SIXPACK_CONFIG_CSRF_DISABLE |
Disable CSRF (optional, used in Web in k8s) |
Manifests in kube/:
sixpack-api-controller.yaml– Deployment for API (command: sixpack,containerPort: 5000)sixpack-web-controller.yaml– Deployment for Web (command: sixpack-web,containerPort: 5001)service-sixpack-api.yaml– Service for API (port 80 → containertargetPort: 5000)service-sixpack-web.yaml– Service for Web (port 80 → containertargetPort: 5001)
Deployments use image us.gcr.io/jusbrasil-155317/sixpack:v0.1 (Google Container Registry) and expect a Redis service (e.g. sixpack-redis-db).