Create Dockerfile for this project
Hey! 👋
I created the Dockerfile in order to create the docker-compose.yml. Can you tell me exactly what do you want? Creating a docker-compose.yml for InfluxDB and Grafana is easy, but gitflux requires to run the commands manually. Would you just like the InfluxDB and the Grafana in the docker-compose.yml ?
In addition, do you want a CI and possibly a CD for the Docker images?
We'll need a docker-compose with InfluxDB & Grafana being preconfigured:
- InfluxDB needs a bucket that we can write to
- Grafana needs to reach and know about the InfluxDB datasource
With regards to gitflux we have two options:
- Run it every couple of minutes as a service
- Add a daemon mode to gitflux, that keeps running and automatically polls data in intervals
Do you want a CI/CD for Docker builds ?
Do you want a CI/CD for Docker builds ?
It would be nice to automatically build and push new docker images from goreleaser, so we have a unified release approach. Additionally we could build an unstable image for every push to master.
Okay! You are using InfluxDB version 2.0 right ?
Using 1.8.3 here currently. I think there hasn't been a stable release of version 2 yet.
Using 1.8.3 here currently. I think there hasn't been a stable release of version 2 yet.
Is it possible to generate a InfluxDB token in v1.8.3 ?
There is my draft docker-compose.yml file. It's working well.
I would like to "auto setup" a user access token to make gitflux work out of the box, with the --influx-token. Searching about how to do this, I do not find any way to generate an access token for InfluxDB v1.8.3.
version: "3.8"
services:
influxdb:
image: influxdb:1.8.3-alpine
volumes:
- influxdb-data:/var/lib/influxdb
- ./influxdb/create-token.sh:/docker-entrypoint-initdb.d/create-token.sh
environment:
INFLUXDB_ADMIN_USER: gitflux
INFLUXDB_ADMIN_PASSWORD: gitflux
INFLUXDB_DB: gitflux
INFLUXDB_USER: gitflux
INFLUXDB_USER_PASSWORD: gitflux
ports:
- 8086:8086
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8086"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 20s
restart: always
grafana:
image: grafana/grafana
environment:
GF_SECURITY_ADMIN_USER: gitflux
GF_SECURITY_ADMIN_PASSWORD: gitflux
ports:
- 3000:3000
user: 472:472
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 20s
volumes:
- grafana-storage:/var/lib/grafana
- ./grafana/influxdb-datasource.yml:/etc/grafana/provisioning/datasources/influxdb-datasource.yml
- ./grafana/grafana-dashboard-provider.yml:/etc/grafana/provisioning/dashboards/grafana-dashboard-provider.yml
- ./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json
- ./grafana/project_dashboard.json:/var/lib/grafana/dashboards/project_dashboard.json
depends_on:
- influxdb
restart: always
volumes:
influxdb-data:
grafana-storage:
I think instead of the token you can also alternatively specify a user/password combination. Alternatively we could make influxdb only reachable from within the container's context and make it auth-less.