trying for the hard fix

This commit is contained in:
armistace 2025-05-30 17:25:13 +10:00
parent 0005ad1fd3
commit 2dd371408f
5 changed files with 70 additions and 18 deletions

4
.gitignore vendored
View File

@ -3,3 +3,7 @@ __pycache__
.venv
.aider*
.vscode
.zed
pyproject.toml
.ropeproject
generated_files/*

View File

@ -7,8 +7,12 @@ ENV PYTHONUNBUFFERED 1
ADD src/ /blog_creator
RUN apt-get update && apt-get install -y rustc cargo python-is-python3 pip python3.12-venv libmagic-dev
RUN apt-get update && apt-get install -y rustc cargo python-is-python3 pip python3-venv libmagic-dev git
# Need to set up git here or we get funky errors
RUN git config --global user.name "Blog Creator"
RUN git config --global user.email "ridgway.infrastructure@gmail.com"
RUN git config --global push.autoSetupRemote true
#Get a python venv going as well cause safety
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

View File

@ -3,10 +3,19 @@
This creator requires you to use a working Trilium Instance and create a .env file with the following
```
TRILIUM_HOST
TRILIUM_PORT
TRILIUM_PROTOCOL
TRILIUM_PASS
TRILIUM_HOST=
TRILIUM_PORT=
TRILIUM_PROTOCOL=
TRILIUM_PASS=
TRILIUM_TOKEN=
OLLAMA_PROTOCOL=
OLLAMA_HOST=
OLLAMA_PORT=11434
EMBEDDING_MODEL=
EDITOR_MODEL=
# This is expected in python list format example `[phi4-mini:latest, qwen3:1.7b, gemma3:latest]`
CONTENT_CREATOR_MODELS=
CHROMA_SERVER=<IP_ADDRESS>
```
This container is going to be what I use to trigger a blog creation event
@ -29,7 +38,7 @@ To do this we will
4. cd /src/content
5. take the information from the trillium note and prepare a 500 word blog post, insert the following at the top
5. take the information from the trillium note and prepare a 500 word blog post, insert the following at the top
```
Title: <title>
@ -42,7 +51,7 @@ Authors: <model name>.ai
Summary: <have ai write a 10 word summary of the post
```
6. write it to `<title>.md`
6. write it to `<title>.md`
7. `git checkout -b <title>`

View File

@ -1,11 +1,44 @@
services:
blog_creator:
build:
context: .
dockerfile: Dockerfile
container_name: blog_creator
env_file:
- .env
volumes:
- ./generated_files/:/blog_creator/generated_files
networks:
net:
driver: bridge
services:
blog_creator:
build:
context: .
dockerfile: Dockerfile
container_name: blog_creator
env_file:
- .env
volumes:
- ./generated_files/:/blog_creator/generated_files
networks:
- net
chroma:
image: chromadb/chroma
container_name: chroma
volumes:
# Be aware that indexed data are located in "/chroma/chroma/"
# Default configuration for persist_directory in chromadb/config.py
# Read more about deployments: https://docs.trychroma.com/deployment
- chroma-data:/chroma/chroma
#command: "--host 0.0.0.0 --port 8000 --proxy-headers --log-config chromadb/log_config.yml --timeout-keep-alive 30"
environment:
- IS_PERSISTENT=TRUE
restart: unless-stopped # possible values are: "no", always", "on-failure", "unless-stopped"
ports:
- "8000:8000"
healthcheck:
# Adjust below to match your container port
test:
["CMD", "curl", "-f", "http://localhost:8000/api/v2/heartbeat"]
interval: 30s
timeout: 10s
retries: 3
networks:
- net
volumes:
chroma-data:
driver: local

View File

@ -2,3 +2,5 @@ ollama
trilium-py
gitpython
PyGithub
chromadb
langchain-ollama