Deploying Assurance-as-Code
The backend runs as a set of containers managed by Docker Compose. The development stack includes the API, PostgreSQL, Valkey, an ARQ worker, and nginx. The web workspace is served by the API at /app; it is not a separate container.
This quickstart is for local development. For a deployed service, use the production installation guidance instead. If you already run Redis, follow upgrading from Redis before starting the updated stack.
What gets deployed
| Service | Role |
|---|---|
api | FastAPI backend — handles all artifact, project, and baseline operations |
postgres | PostgreSQL — stores all projects, artifacts, relationships, and audit events |
worker | ARQ background job runner — processes async validation and gate checks |
redis | Valkey 8.1.10 (valkey/valkey:8.1.10-alpine) — Redis-compatible queue transport for ARQ |
nginx | Reverse proxy — routes traffic to the API, including the web workspace |
The service name redis, setting AAC_REDIS_URL, redis:// URL scheme, port 6379, and development override AAC_REDIS_PORT remain unchanged for client compatibility. These names do not mean that the Redis server is still deployed.
Prerequisites
- Docker and Docker Compose installed on the host machine
- Default development host ports
5432,6379,8000, and8080available, or port overrides as shown below - Disk space for container images, database storage, and application data
1) Clone the repository
git clone https://github.com/polyplay/lydianai_assurance_as_code.git
cd lydianai_assurance_as_code
2) Prepare the development configuration
Copy the example environment file:
cp .env.example .env
The application uses settings such as AAC_DATABASE_URL, AAC_REDIS_URL, AAC_JWT_SECRET, and AAC_SECRET_ENCRYPTION_KEY — not SECRET_KEY or BASE_URL. The root .env.example uses localhost database and broker URLs for running Python processes directly on the host.
The development Compose file supplies its own container settings, including:
AAC_DATABASE_URL=postgresql+asyncpg://aac:aac@postgres:5432/aac
AAC_REDIS_URL=redis://redis:6379/0
AAC_ENVIRONMENT=development
It also supplies fixed development database credentials and a development JWT secret. Editing those values in .env does not override the explicit container settings in docker-compose.yml. Do not expose this development stack to untrusted networks or use it as a production deployment.
Host port overrides are supported. If the default ports are already in use, set any required overrides in .env:
AAC_POSTGRES_PORT=15432
AAC_REDIS_PORT=16379
AAC_API_PORT=18000
AAC_NGINX_PORT=18080
These change published host ports, not container-to-container addresses. The access URLs below assume the default ports.
3) Start the services
docker compose up --build -d
The first run builds the application image and pulls the service images. The API container applies Alembic migrations before starting the server.
Check that all services are healthy:
docker compose ps
4) Access the web console
Create the first administrator in the running API container, using a unique password:
docker compose exec api python -m aac_backend.cli create-admin \
--username admin \
--display-name Admin \
--email admin@example.com \
--password 'replace-with-a-unique-password'
Open the workspace and sign in:
| Endpoint | Default development URL |
|---|---|
| Web workspace | http://127.0.0.1:8000/app |
| API | http://127.0.0.1:8000/api/v1 |
| Interactive API documentation | http://127.0.0.1:8000/api/v1/docs |
| API health | http://127.0.0.1:8000/api/v1/health |
| Workspace through nginx | http://127.0.0.1:8080/app |
The API and its documentation are also available through nginx on port 8080, with the same paths. Adjust host ports if you configured overrides.
Production installation
Production uses installer/backend/docker-compose.backend.yml, not the root development Compose file. The production installer requires --tls-cert and --tls-key when starting the stack and generates database, JWT, and connector-secret encryption values. nginx publishes HTTP/HTTPS on ports 80/443 by default; PostgreSQL, Valkey, and the API are not published directly.
Consult the current installer usage, production Compose configuration, and backend installer guide. Production secrets and ports belong in the installation’s .env; protect that file and preserve the connector-secret encryption key. Use the production configuration as the authority for exposed ports and TLS requirements.
Upgrading from Redis
Existing Redis installations must follow the app’s Valkey migration procedure before upgrading. Drain queued and running work, back up PostgreSQL and the original Redis data, and retain the original deployment configuration for rollback.
Production Valkey uses a fresh valkey_data volume. Do not mount, copy, or rename the old redis_data volume into it: Redis 7.4 and later RDB/AOF files are incompatible with Valkey. Keep the Compose project name unchanged to preserve the existing PostgreSQL and upload volume identities.
Do not run docker compose down -v or volume-pruning commands during migration. Switching servers does not automatically replay jobs. Verify Valkey health and a queued application job to completion before reopening access, and retain the original Redis data for the rollback window.
Application and third-party licences
The project’s own backend and web frontend code are licensed under Apache License, Version 2.0 (Apache-2.0).
The Valkey server uses BSD-3-Clause, with its version-specific copyright notices preserved. Other dependencies, tools, and container packages retain their own terms; they are not relicensed by the app’s Apache-2.0 declaration. See the app’s third-party notices and dependency and licence audit for the current scope and remaining release obligations.
Stopping and restarting
# Stop services and preserve named volumes
docker compose down
Only PostgreSQL has a named persistent volume in the development Compose file. Do not rely on development broker storage to retain queued work across container replacement; drain work before shutting down.
Restart the development stack with docker compose up --build -d. Use docker compose down -v only for a deliberate disposable-development reset after confirming that no data is needed: it deletes the PostgreSQL volume. It is not an upgrade or migration step.
Next steps
- Creating a project — set up your first SW System project
- Managing artifacts — add requirements, hazard analyses, test cases