docker-compose.yaml 1021 B

123456789101112131415161718192021222324
  1. ---
  2. volumes:
  3. influxdb-data:
  4. services:
  5. influxdb:
  6. container_name: influxdb
  7. image: influxdb:2.1-alpine
  8. ports:
  9. - '8086:8086'
  10. volumes:
  11. - influxdb-data:/var/lib/influxdb2
  12. - /etc/influxdb2:/etc/influxdb2
  13. # - /etc/ssl/cert.pem/:/etc/ssl/cert.pem # (optional) if you're using self-signed certs
  14. # - /etc/ssl/cert-key.pem/:/etc/ssl/cert-key.pem # (optional) if you're using self-signed certs
  15. # command: influxd --tls-cert=/etc/ssl/cert.pem --tls-key=/etc/ssl/cert-key.pem # (optional) if you're using self-signed certs
  16. environment:
  17. - DOCKER_INFLUXDB_INIT_MODE=setup
  18. - DOCKER_INFLUXDB_INIT_USERNAME=my-user
  19. - DOCKER_INFLUXDB_INIT_PASSWORD=my-password
  20. - DOCKER_INFLUXDB_INIT_ORG=my-org
  21. - DOCKER_INFLUXDB_INIT_BUCKET=my-bucket
  22. # - DOCKER_INFLUXDB_INIT_RETENTION=1w # (optional) configure data retention 1 week
  23. # - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=my-super-secret-auth-token # (optional) set admin token
  24. restart: unless-stopped