bind docker to docker/.env so dumps persist between restarts

This commit is contained in:
timothycarambat 2023-11-01 22:12:30 -07:00
parent 2afe3faed8
commit 7d3d0e03c6
5 changed files with 11 additions and 9 deletions

View File

@ -11,4 +11,5 @@ collector/outputs/**
**/__pycache__/ **/__pycache__/
**/.env **/.env
**/.env.* **/.env.*
!docker/.env.example
!frontend/.env.production !frontend/.env.production

View File

@ -5,9 +5,9 @@ CACHE_VECTORS="true"
########################################### ###########################################
######## LLM API SElECTION ################ ######## LLM API SElECTION ################
########################################### ###########################################
LLM_PROVIDER='openai' # LLM_PROVIDER='openai'
# OPEN_AI_KEY= # OPEN_AI_KEY=
OPEN_MODEL_PREF='gpt-3.5-turbo' # OPEN_MODEL_PREF='gpt-3.5-turbo'
# LLM_PROVIDER='azure' # LLM_PROVIDER='azure'
# AZURE_OPENAI_ENDPOINT= # AZURE_OPENAI_ENDPOINT=
@ -36,13 +36,13 @@ OPEN_MODEL_PREF='gpt-3.5-turbo'
# CHROMA_API_KEY="sk-123abc" # CHROMA_API_KEY="sk-123abc"
# Enable all below if you are using vector database: Pinecone. # Enable all below if you are using vector database: Pinecone.
VECTOR_DB="lancedb" # VECTOR_DB="pinecone"
PINECONE_ENVIRONMENT= # PINECONE_ENVIRONMENT=
PINECONE_API_KEY= # PINECONE_API_KEY=
PINECONE_INDEX= # PINECONE_INDEX=
# Enable all below if you are using vector database: LanceDB. # Enable all below if you are using vector database: LanceDB.
# VECTOR_DB="lancedb" VECTOR_DB="lancedb"
# Enable all below if you are using vector database: Weaviate. # Enable all below if you are using vector database: Weaviate.
# VECTOR_DB="weaviate" # VECTOR_DB="weaviate"
@ -58,6 +58,5 @@ PINECONE_INDEX=
# AUTH_TOKEN="hunter2" # This is the password to your application if remote hosting. # AUTH_TOKEN="hunter2" # This is the password to your application if remote hosting.
# NO_DEBUG="true" # NO_DEBUG="true"
STORAGE_DIR="/app/server/storage" STORAGE_DIR="/app/server/storage"
GOOGLE_APIS_KEY=
UID='1000' UID='1000'
GID='1000' GID='1000'

View File

@ -37,6 +37,7 @@ RUN groupadd -g $ARG_GID anythingllm && \
# Copy docker helper scripts # Copy docker helper scripts
COPY ./docker/docker-entrypoint.sh /usr/local/bin/ COPY ./docker/docker-entrypoint.sh /usr/local/bin/
COPY ./docker/docker-healthcheck.sh /usr/local/bin/ COPY ./docker/docker-healthcheck.sh /usr/local/bin/
COPY --chown=anythingllm:anythingllm ./docker/.env.example /app/server/.env
# Ensure the scripts are executable # Ensure the scripts are executable
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \ RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \

View File

@ -9,7 +9,7 @@ Use the Dockerized version of AnythingLLM for a much faster and complete startup
- `git clone` this repo and `cd anything-llm` to get to the root directory. - `git clone` this repo and `cd anything-llm` to get to the root directory.
- `touch server/storage/anythingllm.db` to create empty SQLite DB file. - `touch server/storage/anythingllm.db` to create empty SQLite DB file.
- `cd docker/` - `cd docker/`
- `cp .env.example .env` - `cp .env.example .env` **you must do this before building**
- `docker-compose up -d --build` to build the image - this will take a few moments. - `docker-compose up -d --build` to build the image - this will take a few moments.
Your docker host will show the image as online once the build process is completed. This will build the app to `http://localhost:3001`. Your docker host will show the image as online once the build process is completed. This will build the app to `http://localhost:3001`.

View File

@ -18,6 +18,7 @@ services:
ARG_UID: ${UID} ARG_UID: ${UID}
ARG_GID: ${GID} ARG_GID: ${GID}
volumes: volumes:
- "./.env:/app/server/.env"
- "../server/storage:/app/server/storage" - "../server/storage:/app/server/storage"
- "../collector/hotdir/:/app/collector/hotdir" - "../collector/hotdir/:/app/collector/hotdir"
- "../collector/outputs/:/app/collector/outputs" - "../collector/outputs/:/app/collector/outputs"