CatgirlIntelligenceAgency/docker-compose.yml

301 lines
8.6 KiB
YAML
Raw Normal View History

2024-01-11 09:43:08 +01:00
# 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.
#
2023-03-04 13:19:01 +01:00
x-svc: &service
env_file:
2023-03-04 14:24:38 +01:00
- "run/env/service.env"
2023-03-04 13:19:01 +01:00
volumes:
- conf:/wmsa/conf:ro
- model:/wmsa/model
2023-03-25 10:20:44 +01:00
- data:/wmsa/data
2023-10-15 18:38:30 +02:00
- logs:/var/log/wmsa
networks:
- wmsa
labels:
- "__meta_docker_port_private=7000"
2023-10-15 18:38:30 +02:00
x-p1: &partition-1
env_file:
- "run/env/service.env"
volumes:
- conf:/wmsa/conf:ro
- model:/wmsa/model
- data:/wmsa/data
2023-03-04 13:19:01 +01:00
- logs:/var/log/wmsa
2023-10-16 17:37:26 +02:00
- index-1:/idx
- work-1:/work
- backup-1:/backup
- samples-1:/storage
2023-03-04 13:19:01 +01:00
networks:
- wmsa
depends_on:
- mariadb
2023-10-15 18:38:30 +02:00
environment:
- "WMSA_SERVICE_NODE=1"
2023-10-16 17:37:26 +02:00
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
2023-10-16 17:37:26 +02:00
environment:
- "WMSA_SERVICE_NODE=2"
2023-03-04 13:19:01 +01:00
services:
2023-10-15 18:38:30 +02:00
index-service-1:
<<: *partition-1
image: "marginalia/index-service"
2023-10-15 18:38:30 +02:00
container_name: "index-service-1"
executor-service-1:
<<: *partition-1
image: "marginalia/executor-service"
2023-10-15 18:38:30 +02:00
container_name: "executor-service-1"
2023-10-16 17:37:26 +02:00
index-service-2:
<<: *partition-2
image: "marginalia/index-service"
2023-10-16 17:37:26 +02:00
container_name: "index-service-2"
executor-service-2:
<<: *partition-2
image: "marginalia/executor-service"
2023-10-16 17:37:26 +02:00
container_name: "executor-service-2"
query-service:
<<: *service
image: "marginalia/query-service"
container_name: "query-service"
2023-03-04 13:19:01 +01:00
search-service:
<<: *service
image: "marginalia/search-service"
2023-03-04 13:19:01 +01:00
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"
2023-03-04 13:19:01 +01:00
assistant-service:
<<: *service
image: "marginalia/assistant-service"
2023-03-04 13:19:01 +01:00
container_name: "assistant-service"
expose:
- 80
labels:
- "traefik.enable=true"
2023-10-25 14:50:21 +02:00
- "traefik.http.routers.assistant-service-screenshot.rule=PathPrefix(`/screenshot`)"
- "traefik.http.routers.assistant-service-screenshot.entrypoints=search,dating"
2023-10-25 14:50:21 +02:00
- "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"
2023-03-04 13:19:01 +01:00
api-service:
<<: *service
image: "marginalia/api-service"
2023-03-04 13:19:01 +01:00
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"
2023-03-04 13:19:01 +01:00
dating-service:
<<: *service
image: "marginalia/dating-service"
2023-03-04 13:19:01 +01:00
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"
2023-03-04 13:19:01 +01:00
explorer-service:
<<: *service
image: "marginalia/explorer-service"
2023-03-04 13:19:01 +01:00
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"
2023-03-04 13:19:01 +01:00
mariadb:
image: "mariadb:lts"
2023-03-04 13:19:01 +01:00
container_name: "mariadb"
2023-03-04 14:24:38 +01:00
env_file: "run/env/mariadb.env"
2023-03-04 13:19:01 +01:00
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
2023-03-04 13:19:01 +01:00
volumes:
- db:/var/lib/mysql
- "./code/common/db/src/main/resources/sql/current/:/docker-entrypoint-initdb.d/"
2023-03-04 13:19:01 +01:00
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"
2023-03-04 13:19:01 +01:00
ports:
- "127.0.0.1:8080:80"
2023-07-10 18:58:33 +02:00
- "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"
2023-03-04 13:19:01 +01:00
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
2023-03-04 13:19:01 +01:00
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
2023-03-04 13:19:01 +01:00
networks:
wmsa:
volumes:
db:
driver: local
driver_opts:
type: none
o: bind
device: run/db
2023-10-16 17:37:26 +02:00
logs:
2023-10-15 18:38:30 +02:00
driver: local
driver_opts:
type: none
o: bind
2023-10-16 17:37:26 +02:00
device: run/logs
model:
2023-03-04 13:19:01 +01:00
driver: local
driver_opts:
type: none
o: bind
2023-10-16 17:37:26 +02:00
device: run/model
conf:
driver: local
driver_opts:
type: none
o: bind
2023-10-16 17:37:26 +02:00
device: run/conf
data:
2023-03-04 13:19:01 +01:00
driver: local
driver_opts:
type: none
o: bind
2023-10-16 17:37:26 +02:00
device: run/data
samples-1:
2023-03-04 13:19:01 +01:00
driver: local
driver_opts:
type: none
o: bind
2023-10-16 17:37:26 +02:00
device: run/node-1/samples
index-1:
2023-03-25 10:20:44 +01:00
driver: local
driver_opts:
type: none
o: bind
2023-10-16 17:37:26 +02:00
device: run/node-1/index
work-1:
driver: local
driver_opts:
type: none
o: bind
2023-10-16 17:37:26 +02:00
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
2023-10-16 17:37:26 +02:00
device: run/node-2/backup