# Use the base image for AnythingLLM FROM mintplexlabs/anythingllm:render USER root # Create storage directory and link RUN mkdir -p /data/storage RUN ln -s /data/storage /storage # Set environment variables for AnythingLLM storage and server port ENV STORAGE_DIR="/data/storage" ENV SERVER_PORT=7860 # Create and set up SQLite Web specific environment and directories RUN mkdir -p /data/sqlite ENV SQLITE_DATABASE=db_filename.db # Ensure compatibility for storage usage RUN chmod -R 777 /data # Copy the custom script to handle the backup COPY copy-storage.sh /usr/local/bin/copy-storage.sh # Ensure the script has execution permissions RUN chmod +x /usr/local/bin/copy-storage.sh # Switch to AnythingLLM user for safer operations USER anythingllm # Expose ports for AnythingLLM and SQLite Web EXPOSE 7860 EXPOSE 8080 # Switch back to root for setup USER root # Set up SQLite Web entrypoint RUN mkdir -p /usr/local/bin/sqlite-web WORKDIR /usr/local/bin/sqlite-web # Link /data directory for SQLite Web RUN ln -s /data/sqlite /sqlite # Switch back to AnythingLLM user USER anythingllm # Final entrypoint to handle both AnythingLLM and SQLite Web ENTRYPOINT ["/bin/bash","/usr/local/bin/render-entrypoint.sh"]