- Remove hardcoded OpenRouter API key and URL from docker-compose.yml - App service now reads OPENAI_* vars from .env file (env_file) and falls back to http://ollama:11434/v1 defaults - Ollama and model-init moved to 'ollama' Docker Compose profile, so they only start when explicitly requested: docker compose --profile ollama up # with local Ollama docker compose up # cloud provider only - Port mapping uses 5656 from .env - .env.docker updated with documented options for Ollama vs OpenRouter
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
services:
|
|
ollama:
|
|
image: ollama/ollama:latest
|
|
profiles:
|
|
- ollama
|
|
container_name: english-styler-ollama
|
|
ports:
|
|
- "11434:11434"
|
|
volumes:
|
|
- ollama-data:/root/.ollama
|
|
healthcheck:
|
|
test: ["CMD", "ollama", "list"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 30
|
|
start_period: 5s
|
|
restart: unless-stopped
|
|
|
|
model-init:
|
|
image: ollama/ollama:latest
|
|
profiles:
|
|
- ollama
|
|
container_name: english-styler-model-init
|
|
depends_on:
|
|
ollama:
|
|
condition: service_healthy
|
|
environment:
|
|
OLLAMA_HOST: http://ollama:11434
|
|
entrypoint: >
|
|
sh -c "
|
|
echo 'Pulling Ollama model: ${OLLAMA_MODEL:-llama3}' &&
|
|
ollama pull ${OLLAMA_MODEL:-llama3} &&
|
|
echo 'Model ready ✅'
|
|
"
|
|
restart: "no"
|
|
|
|
app:
|
|
build: .
|
|
container_name: english-styler-app
|
|
ports:
|
|
- "${APP_PORT:-5656}:3000"
|
|
env_file:
|
|
- path: .env
|
|
required: false
|
|
environment:
|
|
OPENAI_BASE_URL: ${OPENAI_BASE_URL:-http://ollama:11434/v1}
|
|
OPENAI_API_KEY: ${OPENAI_API_KEY:-ollama}
|
|
OPENAI_MODEL: ${OPENAI_MODEL:-llama3}
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
ollama-data: |