2022-07-12 21:09:41 +02:00
|
|
|
version: "3.9"
|
2020-01-25 22:19:14 +01:00
|
|
|
|
2020-11-22 20:04:56 +01:00
|
|
|
# Required for promtail scraping
|
|
|
|
|
x-logging: &default-logging
|
|
|
|
|
driver: "journald"
|
|
|
|
|
options:
|
|
|
|
|
tag: "{{.Name}}"
|
|
|
|
|
|
2020-01-25 22:19:14 +01:00
|
|
|
services:
|
2022-09-26 18:34:01 +02:00
|
|
|
#####
|
|
|
|
|
## Required services for listory
|
|
|
|
|
#####
|
|
|
|
|
|
2020-01-25 22:19:14 +01:00
|
|
|
db:
|
2024-11-19 09:08:03 +00:00
|
|
|
image: postgres:16.5
|
2020-01-25 22:19:14 +01:00
|
|
|
environment:
|
|
|
|
|
POSTGRES_PASSWORD: listory
|
|
|
|
|
POSTGRES_USER: listory
|
|
|
|
|
POSTGRES_DB: listory
|
|
|
|
|
networks:
|
2020-01-26 19:07:15 +01:00
|
|
|
- db
|
2020-01-25 22:19:14 +01:00
|
|
|
|
2020-01-26 19:07:15 +01:00
|
|
|
api:
|
2020-01-25 22:19:14 +01:00
|
|
|
build:
|
|
|
|
|
context: .
|
2020-01-26 19:07:15 +01:00
|
|
|
target: build-api
|
2020-01-25 22:19:14 +01:00
|
|
|
command: ["npm", "run", "start:dev"]
|
|
|
|
|
environment:
|
2020-05-03 03:47:24 +02:00
|
|
|
DB_HOST: db
|
2020-01-25 22:19:14 +01:00
|
|
|
DB_USERNAME: listory
|
|
|
|
|
DB_PASSWORD: listory
|
2020-05-03 03:47:24 +02:00
|
|
|
DB_DATABASE: listory
|
2020-05-03 20:57:03 +02:00
|
|
|
JWT_SECRET: listory
|
2020-05-03 03:47:24 +02:00
|
|
|
APP_URL: "http://localhost:3000"
|
2022-02-27 17:57:33 +01:00
|
|
|
NODE_ENV: local # pretty logs
|
|
|
|
|
|
2022-09-28 10:11:37 +02:00
|
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: http://tempo:4318
|
2020-01-25 22:19:14 +01:00
|
|
|
env_file: .env
|
|
|
|
|
volumes:
|
2023-10-01 03:35:02 +02:00
|
|
|
- ./src:/app/src:ro
|
|
|
|
|
- ./dist:/app/dist # build cache
|
2020-01-25 22:19:14 +01:00
|
|
|
ports:
|
2022-02-27 17:57:33 +01:00
|
|
|
- 3000 # API
|
|
|
|
|
- "9464:9464" # Metrics
|
2020-01-26 19:07:15 +01:00
|
|
|
labels:
|
|
|
|
|
- "traefik.enable=true" # Enable reverse-proxy for this service
|
2020-02-01 16:11:48 +01:00
|
|
|
- "traefik.http.routers.api.rule=PathPrefix(`/api`)"
|
2020-01-26 19:07:15 +01:00
|
|
|
- "traefik.http.routers.api.entrypoints=web"
|
2020-01-25 22:19:14 +01:00
|
|
|
networks:
|
2020-01-26 19:07:15 +01:00
|
|
|
- web
|
|
|
|
|
- db
|
2020-11-22 20:04:56 +01:00
|
|
|
logging: *default-logging
|
2020-01-26 19:07:15 +01:00
|
|
|
|
|
|
|
|
frontend:
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
target: build-frontend
|
2023-05-07 04:05:11 +02:00
|
|
|
command: ["npm", "run", "start", "--", "--host"]
|
2020-01-26 19:07:15 +01:00
|
|
|
volumes:
|
2023-05-07 04:05:11 +02:00
|
|
|
- ./frontend/vite.config.js:/app/frontend/vite.config.js:ro
|
2020-05-02 03:03:19 +02:00
|
|
|
- ./frontend/postcss.config.js:/app/frontend/postcss.config.js:ro
|
2021-05-22 17:30:52 +02:00
|
|
|
- ./frontend/tailwind.config.js:/app/frontend/tailwind.config.js:ro
|
2023-05-07 04:05:11 +02:00
|
|
|
- ./frontend/index.html:/app/frontend/index.html:ro
|
2020-05-02 03:03:19 +02:00
|
|
|
- ./frontend/src:/app/frontend/src:ro
|
|
|
|
|
- ./frontend/public:/app/frontend/public:ro
|
2020-01-26 19:07:15 +01:00
|
|
|
ports:
|
2023-05-07 04:05:11 +02:00
|
|
|
- 5173
|
2020-01-26 19:07:15 +01:00
|
|
|
labels:
|
|
|
|
|
- "traefik.enable=true" # Enable reverse-proxy for this service
|
|
|
|
|
- "traefik.http.routers.frontend.rule=PathPrefix(`/`)"
|
|
|
|
|
- "traefik.http.routers.frontend.entrypoints=web"
|
|
|
|
|
networks:
|
|
|
|
|
- web
|
|
|
|
|
|
|
|
|
|
proxy:
|
2024-11-16 13:28:14 +00:00
|
|
|
image: traefik:v2.11.13
|
2020-01-26 19:07:15 +01:00
|
|
|
command:
|
2020-02-01 16:11:48 +01:00
|
|
|
#- --log.level=debug
|
2020-01-26 19:07:15 +01:00
|
|
|
#- --accesslog=true
|
|
|
|
|
- --api # Enables the web UI
|
|
|
|
|
- --api.insecure=true
|
|
|
|
|
- --providers.docker=true
|
|
|
|
|
- --providers.docker.exposedbydefault=false
|
|
|
|
|
- --providers.docker.network=listory_web
|
|
|
|
|
- --entrypoints.web.address=:3000
|
|
|
|
|
ports:
|
|
|
|
|
- "3000:3000" # The HTTP port
|
|
|
|
|
- "8080:8080" # The web UI
|
|
|
|
|
networks:
|
|
|
|
|
- web
|
|
|
|
|
volumes:
|
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
|
2020-01-25 22:19:14 +01:00
|
|
|
|
2022-09-26 18:34:01 +02:00
|
|
|
#####
|
|
|
|
|
## console REPL
|
|
|
|
|
#####
|
|
|
|
|
|
2022-07-12 21:09:41 +02:00
|
|
|
console:
|
|
|
|
|
profiles:
|
|
|
|
|
- console
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
target: build-api
|
|
|
|
|
command: ["npm", "run", "start:console"]
|
|
|
|
|
stdin_open: true
|
|
|
|
|
tty: true
|
|
|
|
|
environment:
|
|
|
|
|
DB_HOST: db
|
|
|
|
|
DB_USERNAME: listory
|
|
|
|
|
DB_PASSWORD: listory
|
|
|
|
|
DB_DATABASE: listory
|
|
|
|
|
JWT_SECRET: listory
|
|
|
|
|
APP_URL: "http://localhost:3000"
|
|
|
|
|
NODE_ENV: local # pretty logs
|
|
|
|
|
|
2022-09-28 10:11:37 +02:00
|
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: http://tempo:4318
|
2022-07-12 21:09:41 +02:00
|
|
|
env_file: .env
|
|
|
|
|
volumes:
|
2023-10-01 03:35:02 +02:00
|
|
|
- ./src:/app/src:ro
|
|
|
|
|
- ./dist:/app/dist # build cache
|
2022-07-12 21:09:41 +02:00
|
|
|
ports:
|
|
|
|
|
- "9464:9464" # Metrics
|
|
|
|
|
networks:
|
|
|
|
|
- db
|
|
|
|
|
logging: *default-logging
|
|
|
|
|
|
2022-09-26 18:34:01 +02:00
|
|
|
#####
|
|
|
|
|
## Observability
|
|
|
|
|
## Adopted from https://github.com/stefanprodan/dockprom/blob/master/docker-compose.yml
|
|
|
|
|
#####
|
|
|
|
|
|
|
|
|
|
prometheus:
|
|
|
|
|
profiles: ["observability"]
|
2024-11-19 13:07:21 +00:00
|
|
|
image: prom/prometheus:v2.55.1
|
2022-09-26 18:34:01 +02:00
|
|
|
volumes:
|
|
|
|
|
- ./observability/prometheus:/etc/prometheus
|
|
|
|
|
- prometheus_data:/prometheus
|
|
|
|
|
command:
|
|
|
|
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
|
|
|
|
- "--storage.tsdb.path=/prometheus"
|
|
|
|
|
- "--storage.tsdb.retention.time=200h"
|
|
|
|
|
- "--web.enable-lifecycle"
|
|
|
|
|
ports:
|
2023-09-16 13:02:19 +02:00
|
|
|
- "9090:9090"
|
2022-09-26 18:34:01 +02:00
|
|
|
networks:
|
|
|
|
|
- observability
|
|
|
|
|
- web
|
|
|
|
|
|
|
|
|
|
loki:
|
|
|
|
|
profiles: ["observability"]
|
2024-12-09 05:33:16 +00:00
|
|
|
image: grafana/loki:2.9.11
|
2022-09-26 18:34:01 +02:00
|
|
|
command: ["-config.file=/etc/loki/loki.yaml"]
|
|
|
|
|
ports:
|
|
|
|
|
- "3100" # loki needs to be exposed so it receives logs
|
|
|
|
|
volumes:
|
|
|
|
|
- ./observability/loki/loki.yaml:/etc/loki/loki.yaml
|
|
|
|
|
networks:
|
|
|
|
|
- observability
|
|
|
|
|
|
|
|
|
|
promtail:
|
|
|
|
|
profiles: ["observability"]
|
2024-08-27 06:49:06 +00:00
|
|
|
image: grafana/promtail:2.9.10
|
2022-09-26 18:34:01 +02:00
|
|
|
command: ["-config.file=/etc/promtail.yaml"]
|
|
|
|
|
volumes:
|
|
|
|
|
- ./observability/promtail/promtail.yaml:/etc/promtail.yaml
|
|
|
|
|
- /var/lib/docker/containers:/var/lib/docker/containers:ro
|
|
|
|
|
|
|
|
|
|
- /var/log/journal/:/var/log/journal/
|
|
|
|
|
- /run/log/journal/:/run/log/journal/
|
|
|
|
|
- /etc/machine-id:/etc/machine-id
|
|
|
|
|
ports:
|
|
|
|
|
- "3102"
|
|
|
|
|
networks:
|
|
|
|
|
- observability
|
|
|
|
|
depends_on:
|
|
|
|
|
- loki
|
|
|
|
|
|
|
|
|
|
tempo:
|
|
|
|
|
profiles: ["observability"]
|
2024-11-16 01:45:04 +00:00
|
|
|
image: grafana/tempo:2.6.1
|
2022-09-26 18:34:01 +02:00
|
|
|
command: ["-config.file=/etc/tempo.yaml"]
|
|
|
|
|
volumes:
|
|
|
|
|
- ./observability/tempo/tempo.yaml:/etc/tempo.yaml
|
|
|
|
|
- tempo_data:/tmp/tempo
|
|
|
|
|
ports:
|
|
|
|
|
- "3101" # tempo
|
|
|
|
|
- "4318" # OpenTelemetry HTTP
|
|
|
|
|
networks:
|
|
|
|
|
- observability
|
|
|
|
|
- web
|
|
|
|
|
|
|
|
|
|
grafana:
|
|
|
|
|
profiles: ["observability"]
|
2024-12-09 01:12:58 +00:00
|
|
|
image: grafana/grafana-oss:10.4.14
|
2022-09-26 18:34:01 +02:00
|
|
|
volumes:
|
|
|
|
|
- ./observability/grafana/provisioning:/etc/grafana/provisioning
|
|
|
|
|
environment:
|
|
|
|
|
- GF_SECURITY_ADMIN_USER=listory
|
|
|
|
|
- GF_SECURITY_ADMIN_PASSWORD=listory
|
|
|
|
|
- GF_AUTH_ANONYMOUS_ENABLED=true
|
|
|
|
|
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
|
|
|
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
|
|
|
- GF_SERVER_HTTP_PORT=2345
|
|
|
|
|
ports:
|
2023-09-16 13:02:19 +02:00
|
|
|
- "2345:2345"
|
2022-09-26 18:34:01 +02:00
|
|
|
networks:
|
|
|
|
|
- observability
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
prometheus_data: {}
|
|
|
|
|
tempo_data: {}
|
|
|
|
|
|
2020-01-25 22:19:14 +01:00
|
|
|
networks:
|
2020-01-26 19:07:15 +01:00
|
|
|
db: {}
|
|
|
|
|
web: {}
|
2022-09-26 18:34:01 +02:00
|
|
|
observability: {}
|