39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
# Optional pilot only; does not enable indexing or modify the Pages database.
|
|
# docker compose -f docker-compose.yml -f docker-compose.ml.yml up -d --build machine-learning
|
|
services:
|
|
app:
|
|
networks:
|
|
ml-front: {}
|
|
machine-learning:
|
|
build: ./services/machine-learning
|
|
image: pageswiki-machine-learning:dev
|
|
environment:
|
|
PAGES_ML_TOKEN_FILE: /run/secrets/ml-token
|
|
PAGES_ML_MODEL_DIR: /models
|
|
PAGES_ML_ALLOW_OPENAI: "false"
|
|
volumes:
|
|
- ${PAGES_ML_TOKEN_PATH:?Set absolute shared token file path}:/run/secrets/ml-token:ro
|
|
- ${PAGES_ML_MODELS_PATH:?Set absolute trusted model directory path}:/models:ro
|
|
expose: ["8010"]
|
|
networks:
|
|
ml-front: {}
|
|
read_only: true
|
|
tmpfs: [/tmp:size=32m,mode=1777]
|
|
cap_drop: [ALL]
|
|
security_opt: [no-new-privileges:true]
|
|
mem_limit: 1g
|
|
cpus: 1.0
|
|
pids_limit: 64
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8010/healthz', timeout=2).read()"]
|
|
interval: 30s
|
|
timeout: 3s
|
|
retries: 3
|
|
networks:
|
|
ml-front:
|
|
internal: true
|
|
ipam:
|
|
config:
|
|
- subnet: ${PAGES_ML_FRONT_SUBNET:-172.24.1.0/27}
|