diff --git a/assembly/bin/supersonic-docker-compose.sh b/assembly/bin/supersonic-docker-compose.sh new file mode 100644 index 000000000..0fe786b33 --- /dev/null +++ b/assembly/bin/supersonic-docker-compose.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +export SUPERSONIC_VERSION=latest + +docker-compose -f docker-compose.yml -p supersonic up \ No newline at end of file diff --git a/assembly/bin/supersonic-docker-run.sh b/assembly/bin/supersonic-docker-run.sh new file mode 100644 index 000000000..27626ad71 --- /dev/null +++ b/assembly/bin/supersonic-docker-run.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +export SUPERSONIC_VERSION=latest + +#### Set below DB configs to connect to your own database +# Supported DB_TYPE: h2, mysql, postgres +export S2_DB_TYPE=h2 +export S2_DB_HOST= +export S2_DB_PORT= +export S2_DB_USER= +export S2_DB_PASSWORD= +export S2_DB_DATABASE= + +docker run --rm -it -d \ + --name supersonic_standalone \ + -p 9080:9080 \ + -e S2_DB_TYPE=${S2_DB_TYPE} \ + -e S2_DB_HOST=${S2_DB_HOST} \ + -e S2_DB_PORT=${S2_DB_PORT} \ + -e S2_DB_USER=${S2_DB_USER} \ + -e S2_DB_PASSWORD=${S2_DB_PASSWORD} \ + -e S2_DB_DATABASE=${S2_DB_DATABASE} \ + supersonicbi/supersonic:${SUPERSONIC_VERSION} \ No newline at end of file diff --git a/assembly/bin/supersonic-env.sh b/assembly/bin/supersonic-env.sh index 16dca9d70..b37f47923 100755 --- a/assembly/bin/supersonic-env.sh +++ b/assembly/bin/supersonic-env.sh @@ -1,10 +1,11 @@ #!/usr/bin/env bash #### Set below DB configs to connect to your own database +# Comment out below exports to config your DB connection # Supported DB_TYPE: h2, mysql, postgres -export S2_DB_TYPE=h2 -export S2_DB_HOST= -export S2_DB_PORT= -export S2_DB_USER= -export S2_DB_PASSWORD= -export S2_DB_DATABASE= \ No newline at end of file +#export S2_DB_TYPE=h2 +#export S2_DB_HOST= +#export S2_DB_PORT= +#export S2_DB_USER= +#export S2_DB_PASSWORD= +#export S2_DB_DATABASE= \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index e74861da3..50d97a93f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -27,4 +27,4 @@ WORKDIR /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION} EXPOSE 9080 # Command to run the supersonic daemon RUN chmod +x bin/supersonic-daemon.sh -CMD ["bash", "-c", "bin/supersonic-daemon.sh restart standalone docker && tail -f /dev/null"] \ No newline at end of file +CMD ["bash", "-c", "bin/supersonic-daemon.sh restart standalone ${S2_DB_TYPE} && tail -f /dev/null"] \ No newline at end of file diff --git a/docker/docker-build.sh b/docker/docker-build.sh index 14e42c233..ee7f3175d 100644 --- a/docker/docker-build.sh +++ b/docker/docker-build.sh @@ -2,8 +2,8 @@ # Function to execute the build script execute_build_script() { - echo "Executing build script: assembly/bin/supersonic-build.sh" - assembly/bin/supersonic-build.sh + echo "Executing build script: sh assembly/bin/supersonic-build.sh" + sh assembly/bin/supersonic-build.sh } # Function to build the Docker image diff --git a/docker/docker-compose-run.sh b/docker/docker-compose-run.sh deleted file mode 100644 index f994d0e7b..000000000 --- a/docker/docker-compose-run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -SUPERSONIC_VERSION=latest docker-compose -f docker-compose.yml -p supersonic up \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 174fcff4d..57af7eed2 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -30,10 +30,12 @@ services: privileged: true container_name: supersonic_standalone environment: - DB_HOST: supersonic_postgres - DB_NAME: postgres - DB_USERNAME: supersonic_user - DB_PASSWORD: supersonic_password + S2_DB_TYPE: postgres + S2_DB_HOST: supersonic_postgres + S2_DB_PORT: 5432 + S2_DB_DATABASE: postgres + S2_DB_USER: supersonic_user + S2_DB_PASSWORD: supersonic_password ports: - "9080:9080" depends_on: diff --git a/launchers/standalone/src/main/resources/application-docker.yaml b/launchers/standalone/src/main/resources/application-docker.yaml deleted file mode 100644 index 326af1d99..000000000 --- a/launchers/standalone/src/main/resources/application-docker.yaml +++ /dev/null @@ -1,26 +0,0 @@ -spring: - datasource: - driver-class-name: org.postgresql.Driver - url: jdbc:postgresql://${DB_HOST}:${DB_PORT:5432}/${DB_NAME}?stringtype=unspecified - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - sql: - init: - continue-on-error: true - mode: always - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - schema-locations: classpath:db/schema-postgres.sql,classpath:db/schema-postgres-demo.sql - data-locations: classpath:db/data-postgres.sql,classpath:db/data-postgres-demo.sql - -s2: - embedding: - store: - provider: PGVECTOR - base: - url: ${DB_HOST} - port: ${DB_PORT:5432} - databaseName: ${DB_NAME} - user: ${DB_USERNAME} - password: ${DB_PASSWORD} - dimension: 512 \ No newline at end of file