Files
template-app/profiles/mariadb/compose.dev.yaml
T

121 lines
3.2 KiB
YAML

# SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
# Local development for the mariadb profile: MariaDB and Valkey in Docker, the fake platform, the
# migrate job, the demo data, the worker and the web shell. Nothing here is deployed: the platform
# reads compose.yaml alone (conusai.json's `compose.file`).
x-development: &development
NODE_ENV: development
CONUSAI_FAKE_PLATFORM: "1"
CONUSAI_API_URL: http://platform:4010/api
CONUSAI_API_TOKEN: dev-token
CONUSAI_PROJECT_ID: "1"
CONUSAI_ORG_ID: dev
services:
mariadb:
image: mariadb:lts
environment:
MARIADB_ROOT_PASSWORD: mariadb
MARIADB_DATABASE: appdev
volumes:
- mariadb-data:/var/lib/mysql
# Published on loopback only, for `pnpm dev`, which runs the processes on this machine.
ports: ["127.0.0.1:${DEV_MARIADB_PORT:-53307}:3306"]
healthcheck:
test: ["CMD-SHELL", "mariadb-admin ping -h 127.0.0.1 -uroot -pmariadb --silent"]
interval: 5s
timeout: 5s
retries: 20
restart: unless-stopped
valkey:
image: valkey/valkey:9-alpine
volumes:
- valkey-data:/data
ports: ["127.0.0.1:${DEV_VALKEY_PORT:-56380}:6379"]
healthcheck:
test: ["CMD-SHELL", "valkey-cli ping | grep -q PONG"]
interval: 5s
timeout: 5s
retries: 20
restart: unless-stopped
platform:
build:
context: .
dockerfile: Dockerfile
target: runtime
working_dir: /app
command: ["node", "node_modules/@conusai-kit/testing/dist/fake-platform/cli.js"]
environment:
PORT: "4010"
HOST: 0.0.0.0
PUBLIC_URL: http://platform:4010
expose: ["4010"]
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:4010/__e2e/health').then(r=>process.exit(r.ok?0:1),()=>process.exit(1))"]
interval: 5s
timeout: 5s
retries: 20
init: true
restart: unless-stopped
migrate:
environment: *development
depends_on:
mariadb:
condition: service_healthy
seed:
build:
context: .
dockerfile: Dockerfile
target: runtime
working_dir: /app
command: ["node", "apps/worker/dist/seed-main.js"]
environment:
<<: *development
CONUSAI_PUBLIC_URL: ${CONUSAI_PUBLIC_URL:-http://127.0.0.1:3000}
MARIADB_URL: ${MARIADB_URL}
REDIS_URL: ${REDIS_URL}
depends_on:
migrate:
condition: service_completed_successfully
platform:
condition: service_healthy
restart: "no"
init: true
web:
environment:
<<: *development
AUTH_DEV_LOGIN: "1"
AUTH_INSECURE_COOKIES: "1"
ports: ["127.0.0.1:3000:3000"]
depends_on:
mariadb:
condition: service_healthy
valkey:
condition: service_healthy
migrate:
condition: service_completed_successfully
seed:
condition: service_completed_successfully
platform:
condition: service_healthy
worker:
environment: *development
depends_on:
mariadb:
condition: service_healthy
valkey:
condition: service_healthy
migrate:
condition: service_completed_successfully
platform:
condition: service_healthy
volumes:
mariadb-data:
valkey-data: