2023-05-25 14:26:13 +02:00
|
|
|
---
|
2023-09-13 12:35:32 +02:00
|
|
|
# (Optional) when using custom network
|
|
|
|
# networks:
|
|
|
|
# yournetwork:
|
|
|
|
# external: true
|
2023-05-25 14:26:13 +02:00
|
|
|
volumes:
|
|
|
|
influxdb-data:
|
|
|
|
services:
|
|
|
|
influxdb:
|
|
|
|
container_name: influxdb
|
2024-04-13 03:08:19 +02:00
|
|
|
image: docker.io/library/influxdb:2.7.6-alpine
|
2023-09-13 12:44:13 +02:00
|
|
|
# (Optional) remove this section when using traefik
|
2023-05-25 14:26:13 +02:00
|
|
|
ports:
|
|
|
|
- '8086:8086'
|
|
|
|
volumes:
|
|
|
|
- influxdb-data:/var/lib/influxdb2
|
|
|
|
- /etc/influxdb2:/etc/influxdb2
|
2023-09-13 12:35:32 +02:00
|
|
|
# (Optional) when using certificate
|
2023-05-25 14:26:13 +02:00
|
|
|
# - /etc/ssl/cert.pem/:/etc/ssl/cert.pem # (optional) if you're using self-signed certs
|
|
|
|
# - /etc/ssl/cert-key.pem/:/etc/ssl/cert-key.pem # (optional) if you're using self-signed certs
|
2023-09-13 12:35:32 +02:00
|
|
|
# (Optional) when using certificate
|
2023-05-25 14:26:13 +02:00
|
|
|
# command: influxd --tls-cert=/etc/ssl/cert.pem --tls-key=/etc/ssl/cert-key.pem # (optional) if you're using self-signed certs
|
|
|
|
environment:
|
|
|
|
- DOCKER_INFLUXDB_INIT_MODE=setup
|
|
|
|
- DOCKER_INFLUXDB_INIT_USERNAME=my-user
|
|
|
|
- DOCKER_INFLUXDB_INIT_PASSWORD=my-password
|
|
|
|
- DOCKER_INFLUXDB_INIT_ORG=my-org
|
|
|
|
- DOCKER_INFLUXDB_INIT_BUCKET=my-bucket
|
2023-09-13 12:35:32 +02:00
|
|
|
# (Optional) change retention time
|
2023-05-25 14:26:13 +02:00
|
|
|
# - DOCKER_INFLUXDB_INIT_RETENTION=1w # (optional) configure data retention 1 week
|
2023-09-13 12:35:32 +02:00
|
|
|
# (Optional) add admin token
|
2023-05-25 14:26:13 +02:00
|
|
|
# - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=my-super-secret-auth-token # (optional) set admin token
|
2023-09-13 12:35:32 +02:00
|
|
|
# (Optional) when using traefik
|
|
|
|
# labels:
|
|
|
|
# - traefik.enable=true
|
|
|
|
# - traefik.http.services.influxdb.loadbalancer.server.port=8086
|
|
|
|
# - traefik.http.services.influxdb.loadbalancer.server.scheme=https
|
|
|
|
# - traefik.http.routers.influxdb-https.entrypoints=websecure
|
|
|
|
# - traefik.http.routers.influxdb-https.rule=Host(`your-server-url`)
|
|
|
|
# - traefik.http.routers.influxdb-https.tls=true
|
|
|
|
# - traefik.http.routers.influxdb-https.tls.certresolver=your-certresolver
|
|
|
|
# (Optional) when using custom network
|
|
|
|
# networks:
|
|
|
|
# - yournetwork
|
|
|
|
restart: unless-stopped
|