Skip to content

Instantly share code, notes, and snippets.

@bjarneeins
Created October 23, 2022 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjarneeins/df731af965b39818117b3382597a51ef to your computer and use it in GitHub Desktop.
Save bjarneeins/df731af965b39818117b3382597a51ef to your computer and use it in GitHub Desktop.
Docker Compose file for creating a basic InfluxDB2.0 container
version: '3'
services:
influxdb:
image: influxdb:latest
container_name: influxdb
restart: always
volumes:
- influxdb2-data:/var/lib/influxdb2
- influxdb2-config:/etc/influxdb2
ports:
- "172.17.0.1:8041:8086"
environment:
DOCKER_INFLUXDB_INIT_USERNAME: user
DOCKER_INFLUXDB_INIT_PASSWORD: pw
DOCKER_INFLUXDB_INIT_ORG: org
DOCKER_INFLUXDB_INIT_BUCKET: dbname
DOCKER_INFLUXDB_INIT_RETENTION: 30d
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: token
DOCKER_INFLUXDB_INIT_MODE: setup
volumes:
influxdb2-data:
external: true
influxdb2-config:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment