compose.yaml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ---
  2. name: "InfluxDB"
  3. description: "An open-source time series database"
  4. version: "0.0.1"
  5. date: "2023-10-01"
  6. author: "Christian Lempa"
  7. tags:
  8. - influxdb
  9. - monitoring
  10. - database
  11. ---
  12. # (Optional) when using custom network
  13. # networks:
  14. # yournetwork:
  15. # external: true
  16. volumes:
  17. influxdb-data:
  18. services:
  19. influxdb:
  20. container_name: influxdb
  21. image: docker.io/library/influxdb:2.7.12-alpine
  22. # (Optional) remove this section when using traefik
  23. ports:
  24. - '8086:8086'
  25. volumes:
  26. - influxdb-data:/var/lib/influxdb2
  27. - /etc/influxdb2:/etc/influxdb2
  28. # (Optional) when using certificate
  29. # - /etc/ssl/cert.pem/:/etc/ssl/cert.pem # (optional) if you're using self-signed certs
  30. # - /etc/ssl/cert-key.pem/:/etc/ssl/cert-key.pem # (optional) if you're using self-signed certs
  31. # (Optional) when using certificate
  32. # command: influxd --tls-cert=/etc/ssl/cert.pem --tls-key=/etc/ssl/cert-key.pem # (optional) if you're using self-signed certs
  33. environment:
  34. - DOCKER_INFLUXDB_INIT_MODE=setup
  35. - DOCKER_INFLUXDB_INIT_USERNAME=my-user
  36. - DOCKER_INFLUXDB_INIT_PASSWORD=my-password
  37. - DOCKER_INFLUXDB_INIT_ORG=my-org
  38. - DOCKER_INFLUXDB_INIT_BUCKET=my-bucket
  39. # (Optional) change retention time
  40. # - DOCKER_INFLUXDB_INIT_RETENTION=1w # (optional) configure data retention 1 week
  41. # (Optional) add admin token
  42. # - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=my-super-secret-auth-token # (optional) set admin token
  43. # (Optional) when using traefik
  44. # labels:
  45. # - traefik.enable=true
  46. # - traefik.http.services.influxdb.loadbalancer.server.port=8086
  47. # - traefik.http.services.influxdb.loadbalancer.server.scheme=https
  48. # - traefik.http.routers.influxdb-https.entrypoints=websecure
  49. # - traefik.http.routers.influxdb-https.rule=Host(`your-server-url`)
  50. # - traefik.http.routers.influxdb-https.tls=true
  51. # - traefik.http.routers.influxdb-https.tls.certresolver=your-certresolver
  52. # (Optional) when using custom network
  53. # networks:
  54. # - yournetwork
  55. restart: unless-stopped