* chore(dev): run one threads Celery worker with beat in dev The Docker and native dev stacks start a single Celery worker for every queue, with redbeat embedded, instead of a worker, an export worker and a beat process. It uses a new ThreadsPool that sends worker_process_init, so telemetry and the lazy import check still run under the threads pool. * fix(ws): stop closing every event loop's Redis pools after a broadcast send_messages_to_channel_group called channel_layer.close_pools(), which closes the pools of every event loop, including the ones other worker threads are still sending with. Under the threads pool about a third of broadcasts failed with "attached to a different loop" and some hung. channels_redis now closes a loop's pools itself when that loop closes. * fix(telemetry): keep Celery trace context per thread on threads workers The Celery instrumentation keys a running task's span, context token and start time by the task's id. A task replaced with self.replace(), like every automation node, keeps its id, and on a threads worker the replacement can start in another thread before the original ends. The original then ended the replacement's span and detached its context from the wrong thread, logging "Failed to detach context" and leaving its own context on the thread. That state is now kept per thread. * feat(celery): enforce soft and hard time limits in ThreadsPool Celery's own threads pool ignores soft_time_limit and time_limit, so on a threads worker tasks that rely on them would run on. ThreadsPool now raises the limit in the task's thread, only while that task runs, so a limit never reaches the next task of the thread. EMAIL_TIMEOUT stops a silent SMTP server from blocking a worker thread forever. * fix(chat-runs): cancel a run that keeps going after its deadline The deadline only asks a run to stop. A run whose tools or provider call ignore that request now gets 60 more seconds, is then cancelled, and is saved as timed out. Celery's limit moves after that, so the run's own stop always comes first. On a threads worker this is the only way to end it, because a time limit can't reach a thread waiting inside async_to_sync. * fix(premium): share one capped thread pool across AI field generations Each generation started its own pool of BASEROW_AI_FIELD_MAX_CONCURRENT_GENERATIONS threads, so a threads worker running several jobs multiplied the threads and model calls. All generations in a process now share one pool of that size. A prefork process runs one job at a time, so nothing changes there. * feat(celery): cancel queries at the hard limit and report overdue tasks ThreadsPool checks every running task's time limits from one watchdog thread, like the prefork pool's timeout handler, instead of starting timer threads for each task. At the hard limit it also cancels the query the task's thread is running, which the limit's exception can't interrupt. A thread can't be killed, so a task still running 60 seconds after its hard limit is reported to Sentry instead. Every limit reached is counted in baserow.celery.task.time_limit, per task and limit. * fix(airtable): time out requests to Airtable Two Airtable import requests had no timeout, so a server that stopped answering held the import, and on a threads worker its thread, forever. All Airtable requests now use the same 3 minute read timeout. * fix(celery): load sentry_sdk only when reporting an overdue task The overdue report imported sentry_sdk at the top of baserow.config.celery, which every process imports, so it was loaded even with Sentry off. * chore: add a changelog entry for the Celery task timeouts * fix(celery): raise threads pool time limits at the task's next query An exception raised into a thread from outside can land right after a lock is taken and before the code that releases it, leaving the lock held for every thread of the worker. The pool now marks a reached limit and the task's own next query raises it, once, through a connection execute wrapper. The hard limit still cancels the running query, and raises TimeLimitExceeded whatever the soft limit is. Limits end before Celery's success callback runs. Savepoint queries are never interrupted, through a helper shared with the periodic field update deadline. * fix(celery): apply the worker default time limits on the threads pool Celery passes CELERY_TASK_SOFT_TIME_LIMIT and CELERY_TASK_TIME_LIMIT to the pool and None per task when a task sets no limit. The prefork pool falls back to the pool's values; the threads pool now does too. * fix(celery): keep threads pool time limits until running tasks end The watchdog stopped before on_stop waited for the running tasks, so a task passing its limit during a warm shutdown was never stopped or reported. * chore: name the emails the SMTP timeout covers in the changelog EMAIL_TIMEOUT applies to the instance's own emails only. Automation and builder SMTP steps already time out after 30 seconds. * chore(dev): drop dev.sh tabs for the removed Celery workers The export and beat services are disabled, so attaching to them made the script exit before opening the remaining tabs. * test(celery): cover thread time limits and savepoint rollback * fix(ai): use one generation slot for nonpositive limits * fix(chat): warn that an action may finish after a reply times out * docs(celery): explain which timeout guarantees require prefork * docs(celery): record the threads pool decision and task contract * fix(chat): keep the worker slot until started tools finish * fix(chat): warn visitors about repeating a timed-out request * docs(chat): clarify when the stop grace period begins
8.2 KiB
Running the Dev Environment with Docker
This guide covers running the Baserow development environment using Docker. This is the recommended approach for most developers as it requires minimal local setup and ensures a consistent environment.
Prerequisites
Required Tools
- Docker - Install from https://docs.docker.com/desktop/ or similar alternatives. Allocate at least 4GB RAM (8GB recommended).
- Git - Install from https://git-scm.com/downloads
- just - Command runner
# macOS brew install just # Linux curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/.local/bin
See supported.md for minimum version requirements.
Verify Installation
docker -v
docker compose version
git --version
just --version
Quick Start
# Clone the repository
git clone --branch develop https://github.com/baserow/baserow.git
cd baserow
# Build and start the dev environment
just dc-dev up -d
# View logs (Ctrl+C to stop following)
just dc-dev logs -f
Once started, access:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/api/redoc/
How It Works
The Docker dev environment runs these services:
| Service | Description | Port |
|---|---|---|
web-frontend |
Nuxt.js frontend with hot reload | 3000 |
backend |
Django API server with hot reload | 8000 |
celery |
Background task worker for every queue, with embedded beat. See threads pool and time limits. | - |
db |
PostgreSQL database | 5432 |
redis |
Redis cache and message broker | 6379 |
caddy |
Reverse proxy for media files | 4000 |
mailhog |
Email testing UI | 8025 |
mjml-email-compiler |
MJML to HTML email compiler | 28101 |
otel-collector |
OpenTelemetry OTLP/HTTP telemetry | 4318 |
volume-permissions-fixer |
Fixes media file permissions on startup | - |
web-frontend-storybook |
Component development UI | 6006 |
celery-flower |
Celery task monitoring | 5555 |
Docker Compose Files
docker-compose.yml- Base configuration (production-like)docker-compose.dev.yml- Development overrides (hot reload, volume mounts, dev settings)
The just dc-dev command combines both files automatically.
Common Commands
Shortcuts: dcd = dc-dev, a = dc-attach, dct = dc-dev tabs
Starting and Stopping
# Start all services (detached)
just dc-dev up -d # or: just dcd up -d
# Stop all services (preserves data)
just dc-dev stop
# Stop and remove containers (preserves volumes)
just dc-dev down
# Stop and remove everything including volumes (clean slate)
just dc-dev down -v
Viewing Logs
# All logs
just dc-dev logs
# Follow logs in real-time
just dc-dev logs -f
# Specific services
just dc-dev logs backend
just dc-dev logs web-frontend
just dc-dev logs celery
# Last 100 lines of backend
just dc-dev logs -n 100 backend
Running Commands in Containers
# Open a shell in a container
just a # Interactive container picker
just a backend # Direct shell into backend
just a celery # Interactive container picker, filtered
just dc-dev exec backend bash # Alternative
# Run Django management commands
just dc-dev exec backend python manage.py migrate
just dc-dev exec backend python manage.py createsuperuser
just dc-dev exec backend python manage.py shell_plus
# Run tests inside the container
just dc-dev exec backend just test
just dc-dev exec web-frontend yarn test
Terminal Tabs and Tmux
# Open terminal tabs for each service (like the old dev.sh)
just dc-dev tabs # or: just dct
# Start a tmux session with all services
just dc-dev tmux
Building Images
# Build all images
just dc-dev build --parallel
# Build specific service
just dc-dev build backend
# Build without cache (when things go wrong)
just dc-dev build --no-cache --parallel
# Clear Docker builder cache completely
# WARNING: This clears ALL Docker builder cache, not just Baserow!
just prune
Restarting Services
# Restart a specific service
just dc-dev restart backend
# Rebuild and restart (after Dockerfile changes)
just dc-dev up -d --build backend
# Force recreate containers
just dc-dev up -d --force-recreate
Optional Services
By default, all services including optional ones are started:
| Service | Description | Port |
|---|---|---|
web-frontend-storybook |
Component development UI | 6006 |
celery-flower |
Celery task monitoring | 5555 |
phoenix |
LLM tracing & evals UI for the AI assistant (ai-evals profile) |
6060 |
assistant-eval-runner |
Web page to run the AI assistant evals (ai-evals profile) |
8090 |
This is controlled by the COMPOSE_PROFILES variable in .env.docker-dev. The ai profile starts what the AI assistant needs (embeddings); the ai-evals profile additionally starts phoenix — set BASEROW_ASSISTANT_PHOENIX_URL=http://phoenix:6006 to export assistant traces (see AI assistant tracing).
# Default: start all services including optional ones
COMPOSE_PROFILES=optional
# To disable optional services (save resources), set to empty:
COMPOSE_PROFILES=
After changing this setting, restart the services:
just dc-dev down
just dc-dev up -d
Hot Reloading
Both frontend and backend support hot reloading:
- Frontend: Changes to
.vue,.js,.scssfiles trigger automatic browser refresh - Backend: Changes to
.pyfiles trigger automatic server restart
You don't need to restart containers when editing code.
When to Rebuild
You need to rebuild images when:
Dockerfilechangespackage.jsonoryarn.lockchanges (frontend)pyproject.tomloruv.lockchanges (backend)
just dc-dev build --parallel
just dc-dev up -d
Database Operations
Running Migrations
just dc-dev exec backend python manage.py migrate
Creating a Superuser
just dc-dev exec backend python manage.py createsuperuser
Accessing the Database
# PostgreSQL shell
just dc-dev exec db psql -U baserow
# From backend container
just dc-dev exec backend python manage.py dbshell
Resetting the Database
# Stop services, remove volumes, restart
just dc-dev down -v
just dc-dev up -d
Environment Configuration
Environment Files
The just dc-dev command uses .env.docker-dev to define the environment variables used by the dev containers.
This file is automatically created from .env.docker-dev.example if it doesn't exist.
Customizing Settings
Look at Configuration to customize your .env.docker-dev.
UID/GID for File Permissions
The dev containers run as your host user to avoid permission issues with mounted files:
# These are set automatically by just dc-dev
UID=$(id -u)
GID=$(id -g)
Troubleshooting
Container Won't Start
# Check container status
just dc-dev ps
# View logs for failing service
just dc-dev logs backend
# Rebuild from scratch
just dc-dev down -v
just prune
just dc-dev build --no-cache --parallel
just dc-dev up -d
Slow Performance on macOS
Docker on macOS can be slow with volume mounts. Try:
- Increase Docker Desktop resources (CPU, RAM)
- Use Docker's VirtioFS file sharing (Docker Desktop settings)
- Consider local development for faster iteration
Database Connection Errors
# Ensure db is running and healthy
just dc-dev ps db
# Wait for database to be ready
just dc-dev exec db pg_isready -U baserow
# Check database logs
just dc-dev logs db
Further Reading
- justfile.md - Complete command reference
- running-tests.md - Running tests in Docker
- running-the-dev-env-locally.md - Alternative: local development
- vscode-setup.md - VS Code configuration
- intellij-setup.md - IntelliJ/PyCharm configuration