mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
102 lines
2.6 KiB
YAML
102 lines
2.6 KiB
YAML
version: '3.8'
|
|
services:
|
|
chroma:
|
|
image: chromadb/chroma:0.5.3
|
|
container_name: supersonic_chroma
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- chroma_data:/chroma
|
|
networks:
|
|
- supersonic_network
|
|
dns:
|
|
- 114.114.114.114
|
|
- 8.8.8.8
|
|
- 8.8.4.4
|
|
healthcheck:
|
|
test: ["CMD", "curl", "http://0.0.0.0:8000"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
mysql:
|
|
image: mysql:8.0
|
|
container_name: supersonic_mysql
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: root_password
|
|
MYSQL_DATABASE: supersonic_db
|
|
MYSQL_USER: supersonic_user
|
|
MYSQL_PASSWORD: supersonic_password
|
|
ports:
|
|
- "3306:3306"
|
|
volumes:
|
|
- mysql_data:/var/lib/mysql
|
|
networks:
|
|
- supersonic_network
|
|
dns:
|
|
- 114.114.114.114
|
|
- 8.8.8.8
|
|
- 8.8.4.4
|
|
depends_on:
|
|
chroma:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
db_init:
|
|
image: supersonicbi/supersonic:${SUPERSONIC_VERSION:-latest}
|
|
container_name: supersonic_db_init
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
networks:
|
|
- supersonic_network
|
|
command: >
|
|
sh -c "
|
|
sleep 15 &&
|
|
if ! mysql -h supersonic_mysql -usupersonic_user -psupersonic_password -e 'use supersonic_db; show tables;' | grep -q 's2_database'; then
|
|
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/schema-mysql.sql &&
|
|
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/data-mysql.sql
|
|
else
|
|
echo 'Database already initialized.'
|
|
fi
|
|
"
|
|
dns:
|
|
- 114.114.114.114
|
|
- 8.8.8.8
|
|
- 8.8.4.4
|
|
|
|
supersonic_standalone:
|
|
image: supersonicbi/supersonic:${SUPERSONIC_VERSION:-latest}
|
|
container_name: supersonic_standalone
|
|
environment:
|
|
DB_HOST: supersonic_mysql
|
|
DB_NAME: supersonic_db
|
|
DB_USERNAME: supersonic_user
|
|
DB_PASSWORD: supersonic_password
|
|
CHROMA_HOST: supersonic_chroma
|
|
ports:
|
|
- "9080:9080"
|
|
depends_on:
|
|
chroma:
|
|
condition: service_healthy
|
|
mysql:
|
|
condition: service_healthy
|
|
db_init:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- supersonic_network
|
|
dns:
|
|
- 114.114.114.114
|
|
- 8.8.8.8
|
|
- 8.8.4.4
|
|
|
|
volumes:
|
|
mysql_data:
|
|
chroma_data:
|
|
|
|
networks:
|
|
supersonic_network: |