Skip to content

Docker Compose

The docker-compose.yml defines 5 services:

ServiceImagePortDescription
dbpostgres:15-alpine5432PostgreSQL database
redisredis:7-alpine6379Message broker + channel layer
webBuild from Dockerfile8000Daphne ASGI server
celeryBuild from DockerfileBackground task worker
celery-beatBuild from DockerfilePeriodic task scheduler
Terminal window
# Clone and configure
git clone https://github.com/JINA-CODE-SYSTEMS/jina-connect-unified-cpaas.git
cd jina-connect-unified-cpaas
cp .env.example .env
# Edit .env with your SECRET_KEY and FIELD_ENCRYPTION_KEY
# Start everything
docker compose up -d
# Create admin user
docker compose exec web python manage.py createsuperuser

The production image is based on python:3.13-slim:

FROM python:3.13-slim
# System dependencies
RUN apt-get update && apt-get install -y \
build-essential libpq-dev libjpeg62-turbo-dev zlib1g-dev
# Python dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt
# Application code
COPY . /app
WORKDIR /app
# Collect static files
RUN python manage.py collectstatic --noinput
# ASGI server (HTTP + WebSocket)
CMD ["daphne", "-b", "0.0.0.0", "-p", "8000", "jina_connect.routing:application"]

Docker Compose automatically overrides these for inter-service networking:

environment:
- DB_HOST=db
- CELERY_BROKER_URL=redis://redis:6379/0
- REDIS_URL=redis://redis:6379/0

PostgreSQL data is persisted via a Docker volume:

volumes:
postgres_data:
Terminal window
# View logs
docker compose logs -f web
# Run migrations
docker compose exec web python manage.py migrate
# Django shell
docker compose exec web python manage.py shell
# Restart a specific service
docker compose restart celery
# Rebuild after code changes
docker compose up -d --build web celery celery-beat
# Stop everything
docker compose down
# Stop and remove volumes (DESTRUCTIVE)
docker compose down -v
Terminal window
# Check if web is responding
curl http://localhost:8000/version/
# Check all service status
docker compose ps