-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
54 lines (54 loc) · 3 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
version: "3.9"
services:
# Traefik can be replaced with any reverse proxy, this is just an example
traefik:
image: docker.io/library/traefik:latest # NOTE: Don't use the latest tag in production
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.web.address=:80"
ports:
- "80:80"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
restart: unless-stopped
# SvelteKit frontend, used for server-side rendering and serving web browser clients
frontend:
image: ghcr.io/hearchco/frontend:latest # NOTE: Don't use the latest tag in production
environment:
- PUBLIC_URI=https://search.example.org # Public accessible URI of the frontend, used to generate opensearch.xml
- API_URI=http://agent:8000 # Frontend reachable URI of the agent (private network), used for fetching data when server-side rendering occurs. It can be the same as PUBLIC_API_URI.
- PUBLIC_API_URI=https://api.search.example.org # Public accessible URI of the agent, used for fetching data from the browser (using JS)
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`search.example.org`)"
- "traefik.http.routers.frontend.entrypoints=web"
- "traefik.http.services.frontend.loadbalancer.server.port=3000" # This is the port defined in the Dockerfile for frontend
# Go agent, used for scraping search engines and other data sources and serving a JSON REST API for frontend
agent:
image: ghcr.io/hearchco/agent:latest # NOTE: Don't use the latest tag in production
environment:
- HEARCHCO_SERVER_FRONTENDURLS=http://localhost:5173,https://*search.example.org # Comma separated list, with wildcard (*) support in URIs, used for CORS
- HEARCHCO_SERVER_CACHE_TYPE=redis # Can be "none", "redis" or "dynamodb". Disabling the cache is discouraged.
- HEARCHCO_SERVER_CACHE_REDIS_HOST=redis
- HEARCHCO_SERVER_CACHE_REDIS_PASSWORD=redispassword
# - HEARCHCO_SERVER_CACHE_DYNAMODB_REGION=eu-central-1 # Can be left empty or set to "global" for global tables
# - HEARCHCO_SERVER_CACHE_DYNAMODB_TABLE=hearchco-cache
- HEARCHCO_SERVER_IMAGEPROXY_SECRETKEY=super_secret_key_that_is_at_least_32_chars_long # Used by image proxy for hashing image URLs, set to something long and secure
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.agent.rule=Host(`api.search.example.org`)"
- "traefik.http.routers.agent.entrypoints=web"
- "traefik.http.services.agent.loadbalancer.server.port=8000" # This is the port defined in the Dockerfile for agent
# Redis cache, used by the agent for caching certain non-user related data (like exchange currencies)
redis:
image: docker.io/library/redis:latest # NOTE: Don't use the latest tag in production
command:
- "--requirepass=redispassword"
volumes:
- "redis-vol-0:/data:Z"
restart: unless-stopped
volumes:
redis-vol-0: