grafana-loki-minio/docker-compose.yaml
2025-06-08 08:44:22 +02:00

95 lines
2.5 KiB
YAML

networks:
loki:
name: loki-net # replace the default domain <service>.loki-net
services:
# init container to change permissions of the mounted directory.
init:
image: busybox
user: root
entrypoint: >
/bin/sh -c "
chown 472:root /var/lib/grafana;
chown 101:root /etc/nginx/conf.d/default.conf;
exit 0;
"
volumes:
- '${GF_VOLUME_DIR}:/var/lib/grafana'
- '${PRX_NGINX_CONF_DIR}/default.conf:/etc/nginx/conf.d/default.conf'
networks:
- loki
# container with tools dns (nslookup, tcptraceroute, etc). Use just for debug
# dns-tools:
# image: jonlabelle/network-tools
# command: tail -f /dev/null
# stdin_open: true
# tty: true
# networks:
# - loki
proxy:
image: nginxinc/nginx-unprivileged
volumes:
- ${PRX_NGINX_CONF_DIR}/default.conf:/etc/nginx/conf.d/default.conf
- ${PRX_CERTS_DIR}:/etc/nginx/certs
ports:
- "443:8443"
#- "80:8080"
networks:
- loki
restart: unless-stopped
#
# minio server service
minio:
image: minio/minio
restart: always
volumes:
- ${MINIO_DATA_ROOT_DIR}:/data
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
MINIO_BROWSER_REDIRECT_URL: ${MINIO_REDIRECT_URL}
command: server /data --console-address ":9001"
networks:
- loki
# service not necessary, used here to explain how to interact from the container
# minio-client:
# image: minio/mc
# # insure that the server container is running before building the client
# depends_on:
# - minio
# entrypoint: >
# /bin/sh -c "
# /usr/bin/mc admin info play;
# /usr/bin/mc alias set myminio http://minio:9000 ${MINIO_ACCESS_KEY} ${MINIO_SECRET_KEY};
# /usr/bin/mc mb myminio/test-bucket;
# /usr/bin/mc mb myminio/loki-1;
# echo 'my content' > myfile.txt;
# /usr/bin/mc cp myfile.txt myminio/test-bucket;
# exit 0;
# "
# networks:
# - loki
grafana:
image: grafana/grafana-enterprise
ports:
- "3000:3000"
volumes:
- '${GF_VOLUME_DIR}:/var/lib/grafana'
environment:
- GF_SECURITY_ADMIN_USER=${GF_ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GF_ADMIN_PASS}
- GF_SERVER_ROOT_URL=${GF_ROOT_URL}
#- GF_SERVER_SERVE_FROM_SUB_PATH=true
restart: unless-stopped
networks:
- loki
volumes:
grafana-storage:
# prometheus:
# loki: