# Build all services
VERSION=dev docker compose -f docker-compose.build.yaml build
# Build a specific service alone
VERSION=dev docker compose -f docker-compose.build.yaml build frontend
# Build optional services also
VERSION=dev docker compose -f docker-compose.build.yaml --profile optional buildNOTE: First copy sample.*.env files to *.env and update as required.
# Up all services
VERSION=dev docker compose -f docker-compose.yaml up -d
# Up a specific service alone
VERSION=dev docker compose -f docker-compose.yaml up -d frontend
# Up optional services also
VERSION=dev docker compose -f docker-compose.yaml --profile optional up -dNow access frontend at http://frontend.unstract.localhost
By making use of the merge compose files feature its possible to override some configuration that's used by the services.
Copy and rename the sample.compose.override.yaml to compose.override.yaml and update it as necessary.
cp sample.compose.override.yaml compose.override.yaml
# Configuration in docker-compose.yaml gets overridden
VERSION=dev docker compose -f docker-compose.yaml -f compose.override.yaml up -dThis can be useful during development to:
- Not run some memory intensive services
- Use commands with different arguments to save resources
- Mount additional volumes or define additional env to configure behaviour
Docker Compose Watch (available in Docker Compose v2.22.0+) enables a streamlined development workflow by automatically syncing code changes to containers and restarting services as needed.
-
Ensure you're using Docker Compose v2.22.0 or higher
docker compose version
-
Create your
compose.override.yamlwith watch configurationscp sample.compose.override.yaml compose.override.yaml
-
Start services with watch mode enabled
VERSION=dev docker compose -f docker-compose.yaml -f compose.override.yaml watch
NOTE: Make sure to specify the build definitions also in your
compose.override.yamlfile or specify docker-compose.build.yaml while running the above command.
-
Start services with watch mode:
VERSION=dev docker compose -f docker-compose.yaml -f compose.override.yaml watch
-
Make changes to your code - they're automatically synced and services restart as needed
-
View logs:
docker compose logs -f [service_name]
Enable debugpy by adding compose.debug.yaml:
VERSION=dev docker compose -f docker-compose.yaml -f compose.override.yaml -f compose.debug.yaml watchDebug ports per service:
| Service | Port |
|---|---|
| backend | 5678 |
| runner | 5679 |
| platform-service | 5680 |
| prompt-service | 5681 |
| V2 Workers | |
| worker-file-processing-v2 | 5682 |
| worker-callback-v2 | 5683 |
| worker-api-deployment-v2 | 5684 |
| worker-general-v2 | 5685 |
| worker-notification-v2 | 5686 |
| worker-log-consumer-v2 | 5687 |
| worker-scheduler-v2 | 5688 |
Example launch.json to attach to the backend container:
{
"name": "Docker: Backend Remote Debug",
"type": "debugpy",
"request": "attach",
"connect": { "host": "localhost", "port": 5678 },
"pathMappings": [
{ "localRoot": "${workspaceFolder:unstract}/backend", "remoteRoot": "/app" },
{ "localRoot": "${workspaceFolder:unstract}/unstract", "remoteRoot": "/unstract" }
],
"justMyCode": false,
"django": true
}See VSCode docs for more details.
For the following project structure:
scheduler
|- src
| |- unstract
| |- scheduler
| |- main.py
|- uv.lock
|- pyproject.tomlThis will install the project to:
.venv/lib/python3.12/site-packages/unstract/scheduler/main.pyThis will allow gunicorn to refer the package directly as:
$ gunicorn "-c" "python:unstract.scheduler.config.gunicorn" "unstract.scheduler.main:app"