-
-
Save WahidinAji/75bb631ea231275f40886c11dd06a111 to your computer and use it in GitHub Desktop.
docker compose victoria
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #no auth | |
| VICTORIA_LOGS_ENDPOINT=http://localhost:9428/insert/loki/api/v1/push | |
| #with basic auth | |
| VICTORIA_LOGS_ENDPOINT=http://admin:password@localhost:9428/insert/loki/api/v1/push | |
| VICTORIA_LOGS_LABELS=app=Laravel,env=production | |
| VICTORIA_LOGS_TIMEOUT=1.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| victorialogs: | |
| image: docker.io/victoriametrics/victoria-logs:v1.41.1 | |
| container_name: victorialogs | |
| command: | |
| - "-storageDataPath=/victoria-logs-data" | |
| - "-retention.maxDiskSpaceUsageBytes=40GiB" | |
| volumes: | |
| - ./victoria-logs-data:/victoria-logs-data | |
| cpus: "1.0" | |
| mem_limit: 2g | |
| memswap_limit: 2g | |
| mem_swappiness: 0 | |
| restart: unless-stopped | |
| vmauth: | |
| image: docker.io/victoriametrics/vmauth:v1.106.1 | |
| container_name: vmauth | |
| restart: on-failure | |
| environment: | |
| USERNAME: ${VMAUTH_USERNAME} | |
| PASSWORD: ${VMAUTH_PASSWORD} | |
| volumes: | |
| - ./vmauth-config.yml:/etc/vmauth/vmauth-config.yml:ro | |
| command: -auth.config=/etc/vmauth/vmauth-config.yml | |
| depends_on: | |
| - victorialogs | |
| ports: | |
| - "9428:8427" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| victorialogs: | |
| image: docker.io/victoriametrics/victoria-logs:v1.41.1 | |
| container_name: victorialogs | |
| ports: | |
| - "9428:9428" | |
| volumes: | |
| - ./victoria-logs-data:/victoria-logs-data | |
| command: | |
| - "-storageDataPath=/victoria-logs-data" | |
| - "-retention.maxDiskSpaceUsageBytes=40GiB" | |
| cpus: "1.0" | |
| mem_limit: 2g | |
| memswap_limit: 2g | |
| mem_swappiness: 0 | |
| restart: unless-stopped |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| usage() { | |
| cat <<'EOF' | |
| Usage: | |
| ./run.sh auth # Start victoria-logs behind vmauth (basic auth) | |
| ./run.sh no-auth # Start victoria-logs without auth | |
| ./run.sh help | |
| EOF | |
| } | |
| mode="${1}" | |
| case "$mode" in | |
| auth) | |
| #start victoria-logs + vmauth locally with credentials. | |
| export VMAUTH_USERNAME="${VMAUTH_USERNAME:-admin}" | |
| export VMAUTH_PASSWORD="${VMAUTH_PASSWORD:-password}" | |
| docker compose -f compose-vtlogs-basic-auth.yaml up -d | |
| echo "✅ Started with auth (vmauth)." | |
| ;; | |
| no-auth) | |
| docker compose -f compose-vtlogs.yaml up -d | |
| echo "✅ Started without auth." | |
| ;; | |
| help|-h|--help) | |
| usage | |
| ;; | |
| *) | |
| echo "❌ Unknown mode: $mode" | |
| usage | |
| exit 1 | |
| ;; | |
| esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| users: | |
| - username: "%{USERNAME}" | |
| password: "%{PASSWORD}" | |
| url_prefix: "http://victorialogs:9428/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment