301 lines
8.6 KiB
YAML
301 lines
8.6 KiB
YAML
# This is the full docker-compose.yml file for the Marginalia Search Engine.
|
|
#
|
|
# It starts all the services, including the GUI, the database, the query service,
|
|
# two nodes for demo purposes, as well as a bunch of peripheral services that are
|
|
# application specific.
|
|
#
|
|
|
|
x-svc: &service
|
|
env_file:
|
|
- "run/env/service.env"
|
|
volumes:
|
|
- conf:/wmsa/conf:ro
|
|
- model:/wmsa/model
|
|
- data:/wmsa/data
|
|
- logs:/var/log/wmsa
|
|
networks:
|
|
- wmsa
|
|
labels:
|
|
- "__meta_docker_port_private=7000"
|
|
x-p1: &partition-1
|
|
env_file:
|
|
- "run/env/service.env"
|
|
volumes:
|
|
- conf:/wmsa/conf:ro
|
|
- model:/wmsa/model
|
|
- data:/wmsa/data
|
|
- logs:/var/log/wmsa
|
|
- index-1:/idx
|
|
- work-1:/work
|
|
- backup-1:/backup
|
|
- samples-1:/storage
|
|
networks:
|
|
- wmsa
|
|
depends_on:
|
|
- mariadb
|
|
environment:
|
|
- "WMSA_SERVICE_NODE=1"
|
|
x-p2: &partition-2
|
|
env_file:
|
|
- "run/env/service.env"
|
|
volumes:
|
|
- conf:/wmsa/conf:ro
|
|
- model:/wmsa/model
|
|
- data:/wmsa/data
|
|
- logs:/var/log/wmsa
|
|
- index-2:/idx
|
|
- work-2:/work
|
|
- backup-2:/backup
|
|
- samples-2:/storage
|
|
networks:
|
|
- wmsa
|
|
depends_on:
|
|
mariadb:
|
|
condition: service_healthy
|
|
environment:
|
|
- "WMSA_SERVICE_NODE=2"
|
|
|
|
services:
|
|
index-service-1:
|
|
<<: *partition-1
|
|
image: "marginalia/index-service"
|
|
container_name: "index-service-1"
|
|
executor-service-1:
|
|
<<: *partition-1
|
|
image: "marginalia/executor-service"
|
|
container_name: "executor-service-1"
|
|
index-service-2:
|
|
<<: *partition-2
|
|
image: "marginalia/index-service"
|
|
container_name: "index-service-2"
|
|
executor-service-2:
|
|
<<: *partition-2
|
|
image: "marginalia/executor-service"
|
|
container_name: "executor-service-2"
|
|
query-service:
|
|
<<: *service
|
|
image: "marginalia/query-service"
|
|
container_name: "query-service"
|
|
search-service:
|
|
<<: *service
|
|
image: "marginalia/search-service"
|
|
container_name: "search-service"
|
|
expose:
|
|
- 80
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.search-service.rule=PathPrefix(`/`)"
|
|
- "traefik.http.routers.search-service.entrypoints=search"
|
|
- "traefik.http.routers.search-service.middlewares=add-xpublic"
|
|
- "traefik.http.routers.search-service.middlewares=add-public"
|
|
- "traefik.http.middlewares.add-xpublic.headers.customrequestheaders.X-Public=1"
|
|
- "traefik.http.middlewares.add-public.addprefix.prefix=/public"
|
|
assistant-service:
|
|
<<: *service
|
|
image: "marginalia/assistant-service"
|
|
container_name: "assistant-service"
|
|
expose:
|
|
- 80
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.assistant-service-screenshot.rule=PathPrefix(`/screenshot`)"
|
|
- "traefik.http.routers.assistant-service-screenshot.entrypoints=search,dating"
|
|
- "traefik.http.routers.assistant-service-screenshot.middlewares=add-xpublic"
|
|
- "traefik.http.routers.assistant-service-screenshot.middlewares=add-public"
|
|
- "traefik.http.routers.assistant-service-suggest.rule=PathPrefix(`/suggest`)"
|
|
- "traefik.http.routers.assistant-service-suggest.entrypoints=search"
|
|
- "traefik.http.routers.assistant-service-suggest.middlewares=add-xpublic"
|
|
- "traefik.http.routers.assistant-service-suggest.middlewares=add-public"
|
|
- "traefik.http.middlewares.add-xpublic.headers.customrequestheaders.X-Public=1"
|
|
- "traefik.http.middlewares.add-public.addprefix.prefix=/public"
|
|
api-service:
|
|
<<: *service
|
|
image: "marginalia/api-service"
|
|
container_name: "api-service"
|
|
expose:
|
|
- "80"
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.api-service.rule=PathPrefix(`/`)"
|
|
- "traefik.http.routers.api-service.entrypoints=api"
|
|
- "traefik.http.routers.api-service.middlewares=add-xpublic"
|
|
- "traefik.http.routers.api-service.middlewares=add-public"
|
|
- "traefik.http.middlewares.add-xpublic.headers.customrequestheaders.X-Public=1"
|
|
- "traefik.http.middlewares.add-public.addprefix.prefix=/public"
|
|
dating-service:
|
|
<<: *service
|
|
image: "marginalia/dating-service"
|
|
container_name: "dating-service"
|
|
expose:
|
|
- 80
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.dating-service.rule=PathPrefix(`/`)"
|
|
- "traefik.http.routers.dating-service.entrypoints=dating"
|
|
- "traefik.http.routers.dating-service.middlewares=add-xpublic"
|
|
- "traefik.http.routers.dating-service.middlewares=add-public"
|
|
- "traefik.http.middlewares.add-xpublic.headers.customrequestheaders.X-Public=1"
|
|
- "traefik.http.middlewares.add-public.addprefix.prefix=/public"
|
|
explorer-service:
|
|
<<: *service
|
|
image: "marginalia/explorer-service"
|
|
container_name: "explorer-service"
|
|
expose:
|
|
- 80
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.explorer-service.rule=PathPrefix(`/`)"
|
|
- "traefik.http.routers.explorer-service.entrypoints=explore"
|
|
- "traefik.http.routers.explorer-service.middlewares=add-xpublic"
|
|
- "traefik.http.routers.explorer-service.middlewares=add-public"
|
|
- "traefik.http.middlewares.add-xpublic.headers.customrequestheaders.X-Public=1"
|
|
- "traefik.http.middlewares.add-public.addprefix.prefix=/public"
|
|
control-service:
|
|
<<: *service
|
|
image: "marginalia/control-service"
|
|
container_name: "control-service"
|
|
expose:
|
|
- 80
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.control-service.rule=PathPrefix(`/`)"
|
|
- "traefik.http.routers.control-service.entrypoints=control"
|
|
- "traefik.http.routers.control-service.middlewares=add-xpublic"
|
|
- "traefik.http.routers.control-service.middlewares=add-public"
|
|
- "traefik.http.middlewares.add-xpublic.headers.customrequestheaders.X-Public=1"
|
|
- "traefik.http.middlewares.add-public.addprefix.prefix=/public"
|
|
mariadb:
|
|
image: "mariadb:lts"
|
|
container_name: "mariadb"
|
|
env_file: "run/env/mariadb.env"
|
|
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
|
|
ports:
|
|
- "127.0.0.1:3306:3306/tcp"
|
|
healthcheck:
|
|
test: mysqladmin ping -h 127.0.0.1 -u $$MARIADB_USER --password=$$MARIADB_PASSWORD
|
|
start_period: 5s
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 60
|
|
volumes:
|
|
- db:/var/lib/mysql
|
|
- "./code/common/db/src/main/resources/sql/current/:/docker-entrypoint-initdb.d/"
|
|
networks:
|
|
- wmsa
|
|
traefik:
|
|
image: "traefik:v2.10"
|
|
container_name: "traefik"
|
|
command:
|
|
#- "--log.level=DEBUG"
|
|
- "--api.insecure=true"
|
|
- "--providers.docker=true"
|
|
- "--providers.docker.exposedbydefault=false"
|
|
- "--entrypoints.search.address=:80"
|
|
- "--entrypoints.control.address=:81"
|
|
- "--entrypoints.api.address=:82"
|
|
- "--entrypoints.dating.address=:83"
|
|
- "--entrypoints.explore.address=:84"
|
|
ports:
|
|
- "127.0.0.1:8080:80"
|
|
- "127.0.0.1:8081:81"
|
|
- "127.0.0.1:8082:82"
|
|
- "127.0.0.1:8083:83"
|
|
- "127.0.0.1:8084:84"
|
|
- "127.0.0.1:8090:8080"
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
networks:
|
|
- wmsa
|
|
prometheus:
|
|
image: "prom/prometheus"
|
|
container_name: "prometheus"
|
|
command:
|
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
|
ports:
|
|
- "127.0.0.1:8091:9090"
|
|
volumes:
|
|
- "./run/prometheus.yml:/etc/prometheus/prometheus.yml"
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
networks:
|
|
- wmsa
|
|
networks:
|
|
wmsa:
|
|
volumes:
|
|
db:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/db
|
|
logs:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/logs
|
|
model:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/model
|
|
conf:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/conf
|
|
data:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/data
|
|
samples-1:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/node-1/samples
|
|
index-1:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/node-1/index
|
|
work-1:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/node-1/work
|
|
backup-1:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/node-1/backup
|
|
samples-2:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/node-2/samples
|
|
index-2:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/node-2/index
|
|
work-2:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/node-2/work
|
|
backup-2:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: run/node-2/backup |