mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 13:11:02 +00:00
feat(dev): combine all docker-compose setups
This commit is contained in:
parent
0a9956e1ae
commit
52a5a39cb3
4 changed files with 118 additions and 88 deletions
22
README.md
22
README.md
|
|
@ -102,16 +102,34 @@ Copy the file `.env.sample` to `.env` and add your Spotify API Key.
|
||||||
|
|
||||||
### Starting the application
|
### Starting the application
|
||||||
|
|
||||||
We use `docker-compose` to provide a full local development environment.
|
We use `docker compose` to provide a full local development environment.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker-compose up
|
$ docker compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
You can now access the frontend at `http://localhost:3000` and the API at `http://localhost:3000/api`.
|
You can now access the frontend at `http://localhost:3000` and the API at `http://localhost:3000/api`.
|
||||||
|
|
||||||
Frontend and API will automatically reload on any code changes.
|
Frontend and API will automatically reload on any code changes.
|
||||||
|
|
||||||
|
### REPL Console
|
||||||
|
|
||||||
|
You can start the REPL console by starting the normal environment, and then running:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker compose run console
|
||||||
|
```
|
||||||
|
|
||||||
|
### Observability
|
||||||
|
|
||||||
|
If you want to start the observability suite (Metrics & Tracing) locally, you can use the `observability` docker compose profile:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker compose --profile observability up
|
||||||
|
```
|
||||||
|
|
||||||
|
Grafana is then available at `http://localhost:2345` and all sources are preconfigured.
|
||||||
|
|
||||||
## Test
|
## Test
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@ x-logging: &default-logging
|
||||||
tag: "{{.Name}}"
|
tag: "{{.Name}}"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
#####
|
||||||
|
## Required services for listory
|
||||||
|
#####
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:14.5
|
image: postgres:14.5
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -84,6 +88,10 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
|
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
|
||||||
|
|
||||||
|
#####
|
||||||
|
## console REPL
|
||||||
|
#####
|
||||||
|
|
||||||
console:
|
console:
|
||||||
profiles:
|
profiles:
|
||||||
- console
|
- console
|
||||||
|
|
@ -112,6 +120,93 @@ services:
|
||||||
- db
|
- db
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
|
|
||||||
|
#####
|
||||||
|
## Observability
|
||||||
|
## Adopted from https://github.com/stefanprodan/dockprom/blob/master/docker-compose.yml
|
||||||
|
#####
|
||||||
|
|
||||||
|
prometheus:
|
||||||
|
profiles: ["observability"]
|
||||||
|
image: prom/prometheus:v2.38.0
|
||||||
|
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:
|
||||||
|
- 9090:9090
|
||||||
|
networks:
|
||||||
|
- observability
|
||||||
|
- web
|
||||||
|
|
||||||
|
loki:
|
||||||
|
profiles: ["observability"]
|
||||||
|
image: grafana/loki:2.6.1
|
||||||
|
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"]
|
||||||
|
image: grafana/promtail:2.6.1
|
||||||
|
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"]
|
||||||
|
image: grafana/tempo:1.5.0
|
||||||
|
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"]
|
||||||
|
image: grafana/grafana-oss:9.1.6
|
||||||
|
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:
|
||||||
|
- 2345:2345
|
||||||
|
networks:
|
||||||
|
- observability
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
prometheus_data: {}
|
||||||
|
tempo_data: {}
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
db: {}
|
db: {}
|
||||||
web: {}
|
web: {}
|
||||||
|
observability: {}
|
||||||
|
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
# Adopted from https://github.com/stefanprodan/dockprom/blob/master/docker-compose.yml
|
|
||||||
|
|
||||||
version: "3.4"
|
|
||||||
|
|
||||||
services:
|
|
||||||
prometheus:
|
|
||||||
image: prom/prometheus:v2.38.0
|
|
||||||
volumes:
|
|
||||||
- ./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:
|
|
||||||
- 9090:9090
|
|
||||||
networks:
|
|
||||||
- observability
|
|
||||||
- api
|
|
||||||
|
|
||||||
loki:
|
|
||||||
image: grafana/loki:2.6.1
|
|
||||||
command: ["-config.file=/etc/loki/loki.yaml"]
|
|
||||||
ports:
|
|
||||||
- "3100" # loki needs to be exposed so it receives logs
|
|
||||||
volumes:
|
|
||||||
- ./loki/loki.yaml:/etc/loki/loki.yaml
|
|
||||||
networks:
|
|
||||||
- observability
|
|
||||||
|
|
||||||
promtail:
|
|
||||||
image: grafana/promtail:2.6.1
|
|
||||||
command: ["-config.file=/etc/promtail.yaml"]
|
|
||||||
volumes:
|
|
||||||
- ./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:
|
|
||||||
image: grafana/tempo:1.5.0
|
|
||||||
command: ["-config.file=/etc/tempo.yaml"]
|
|
||||||
volumes:
|
|
||||||
- ./tempo/tempo.yaml:/etc/tempo.yaml
|
|
||||||
- tempo_data:/tmp/tempo
|
|
||||||
ports:
|
|
||||||
- "3101" # tempo
|
|
||||||
- "4318" # OpenTelemetry HTTP
|
|
||||||
networks:
|
|
||||||
- observability
|
|
||||||
- api
|
|
||||||
|
|
||||||
grafana:
|
|
||||||
image: grafana/grafana-oss:9.1.6
|
|
||||||
volumes:
|
|
||||||
- ./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:
|
|
||||||
- 2345:2345
|
|
||||||
networks:
|
|
||||||
- observability
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
prometheus_data: {}
|
|
||||||
tempo_data: {}
|
|
||||||
|
|
||||||
networks:
|
|
||||||
observability: {}
|
|
||||||
api:
|
|
||||||
external: true
|
|
||||||
name: listory_web
|
|
||||||
|
|
@ -34,3 +34,6 @@ storage:
|
||||||
pool:
|
pool:
|
||||||
max_workers: 100 # the worker pool mainly drives querying, but is also used for polling the blocklist
|
max_workers: 100 # the worker pool mainly drives querying, but is also used for polling the blocklist
|
||||||
queue_depth: 10000
|
queue_depth: 10000
|
||||||
|
|
||||||
|
# Enable search functionality
|
||||||
|
search_enabled: true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue