diff --git a/.github/workflows/image-publish.yml b/.github/workflows/image-publish.yml index c32cf780..2a4f8a28 100644 --- a/.github/workflows/image-publish.yml +++ b/.github/workflows/image-publish.yml @@ -1,8 +1,8 @@ name: Publish Docker Image on: - schedule: - # Once weekly on Fridays at noon - - cron: "00 12 * * 5" + release: + types: + - published workflow_dispatch: jobs: @@ -59,7 +59,7 @@ jobs: github_token: ${{ github.token }} workflow: ".github/workflows/import_packages.yml" workflow_conclusion: success - name: sqlite_vectordb_file + name: sqlite_data name_is_regexp: true skip_unpack: false if_no_artifact_found: ignore diff --git a/.github/workflows/import_packages.yml b/.github/workflows/import_packages.yml index dc7a9644..c9da1970 100644 --- a/.github/workflows/import_packages.yml +++ b/.github/workflows/import_packages.yml @@ -79,4 +79,3 @@ jobs: name: sqlite_vectordb_file path: /tmp/sqlite_data/vectordb.db retention-days: 90 - diff --git a/Dockerfile b/Dockerfile index c4cd3829..312ed290 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,11 +64,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Create a non-root user RUN useradd -m -u 1000 -r codegate -# Copy backup if needed -RUN mkdir -p /tmp/weaviate_backup -# will not fail if the file does not exist -COPY weaviate_backu[p] /tmp/weaviate_backup -RUN chown -R codegate /tmp/weaviate_backup # Set permissions for user codegate to run nginx RUN chown -R codegate /var/lib/nginx && \ diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 9b154ecb..22fbed2a 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -1,10 +1,10 @@ #!/bin/bash # those are hardcoded on the image, will not change -BACKUP_PATH="/tmp/weaviate_backup" BACKUP_NAME="backup" MODEL_BASE_PATH="/app/codegate_volume/models" CODEGATE_DB_FILE="/app/codegate_volume/db/codegate.db" +CODEGATE_VEC_DB_FILE="/app/sqlite_data/vectordb.db" CODEGATE_CERTS="/app/codegate_volume/certs" # Function to restore backup if paths are provided @@ -37,7 +37,7 @@ start_application() { # first restore the models mkdir -p /app/codegate_volume/models cp /app/default_models/* /app/codegate_volume/models - CMD_ARGS="--port 8989 --host 0.0.0.0 --model-base-path $MODEL_BASE_PATH --db-path $CODEGATE_DB_FILE" + CMD_ARGS="--port 8989 --host 0.0.0.0 --model-base-path $MODEL_BASE_PATH --db-path $CODEGATE_DB_FILE --vec-db-path $CODEGATE_VEC_DB_FILE" # Check and append additional URLs if they are set [ -n "$CODEGATE_OPENAI_URL" ] && CMD_ARGS+=" --openai-url $CODEGATE_OPENAI_URL"