107 lines
2.9 KiB
YAML
107 lines
2.9 KiB
YAML
# Local development demo/example compose file
|
|
# Composes:
|
|
# - a MySQL database,
|
|
# - a model-registry server built from source connected to the MySQL database.
|
|
# - a model-catalog server built from source.
|
|
# or
|
|
# - a PostgreSQL database,
|
|
# - a model-registry server built from source connected to the PostgreSQL database.
|
|
# - a model-catalog server built from source.
|
|
version: '3.8'
|
|
services:
|
|
model-catalog:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
command: ["catalog", "--listen", "0.0.0.0:8081", "--catalogs-path", "/testdata/test-catalog-sources.yaml"]
|
|
container_name: model-catalog
|
|
ports:
|
|
- "8081:8081"
|
|
volumes:
|
|
- ./catalog/internal/catalog/testdata:/testdata
|
|
depends_on:
|
|
- postgres
|
|
profiles:
|
|
- postgres
|
|
environment:
|
|
- PGHOST=postgres
|
|
- PGDATABASE=model_catalog
|
|
- PGUSER=postgres
|
|
- PGPASSWORD=demo
|
|
|
|
model-registry:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
entrypoint: ["/bin/sh"]
|
|
command:
|
|
- -c
|
|
- |
|
|
if [ "$$DB_TYPE" = "postgres" ]; then
|
|
exec /model-registry proxy --hostname 0.0.0.0 --datastore-type embedmd --embedmd-database-type postgres --embedmd-database-dsn "host=postgres port=5432 user=postgres password=demo dbname=model_registry sslmode=disable"
|
|
else
|
|
exec /model-registry proxy --hostname 0.0.0.0 --datastore-type embedmd --embedmd-database-dsn "root:demo@tcp(mysql:3306)/model_registry?charset=utf8mb4"
|
|
fi
|
|
container_name: model-registry
|
|
ports:
|
|
- "8080:8080"
|
|
depends_on:
|
|
- ${DB_TYPE:-mysql}
|
|
environment:
|
|
- DB_TYPE=${DB_TYPE:-mysql}
|
|
|
|
mysql:
|
|
image: mysql:8.3
|
|
container_name: mysql
|
|
command:
|
|
- --datadir=/var/lib/mysql/datadir
|
|
- --default-authentication-plugin=mysql_native_password
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=demo
|
|
- MYSQL_DATABASE=model_registry
|
|
ports:
|
|
- "3306:3306"
|
|
volumes:
|
|
- mysql_data:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "mysql -D $$MYSQL_DATABASE -uroot -p$$MYSQL_ROOT_PASSWORD -e 'SELECT 1'"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 20s
|
|
profiles:
|
|
- mysql
|
|
|
|
postgres:
|
|
image: postgres:15
|
|
container_name: postgres
|
|
environment:
|
|
- POSTGRES_DB=model_registry
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=demo
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d model_registry"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 20s
|
|
profiles:
|
|
- postgres
|
|
configs:
|
|
- source: pginit
|
|
target: /docker-entrypoint-initdb.d/pginit.sql
|
|
|
|
volumes:
|
|
mysql_data:
|
|
postgres_data:
|
|
|
|
configs:
|
|
pginit:
|
|
content: |
|
|
CREATE DATABASE model_catalog;
|
|
GRANT ALL PRIVILEGES ON model_catalog TO postgres;
|