Hi, I’m trying to deploy a prototype of an app I have working locally.
It’s made up of a docker-compose.yml
file I’ll post the contents of in a moment; but it’s basically an instance of InfluxDB, Telegraf, and Grafana.
I know that Fly.io requires a fly.toml
to configure my app but I don’t know how to translate my docker-compose.yml file to its equivalent fly.toml
configuration.
I understand that each of my services should likely be its own app, running separately; but as I mentioned, this is just going to be a small prototype to play with. It’s nothing I plan to release and sell in this state.
I’ve read through similar-sounding topics in these forums and read through the documentation but still could not figure out how to go about this. I would appreciate any help or guidance. Thank you!
version: "3.8"
services:
influxdb:
image: influxdb:latest
container_name: influxdb
ports:
- "8086:8086"
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUXDB_USERNAME:-admin}
DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_PASSWORD:-admin123}
DOCKER_INFLUXDB_INIT_ORG: ${INFLUXDB_ORG:-my-org}
DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUXDB_BUCKET:-telegraf}
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN}
DOCKER_INFLUXDB_INIT_RETENTION: ${INFLUXDB_RETENTION:-4d}
volumes:
- influxdb_data:/var/lib/influxdb2
healthcheck:
test: ["CMD", "influx", "ping", "-host", "http://localhost:8086"]
interval: 5s
timeout: 5s
retries: 5
telegraf:
image: telegraf:latest
container_name: telegraf
depends_on:
- influxdb
volumes:
- ./telegraf/telegraf.d:/etc/telegraf/telegraf.d # For modular configuration
environment:
INFLUXDB_URL: http://influxdb:8086
INFLUXDB_TOKEN: ${INFLUXDB_ADMIN_TOKEN}
INFLUXDB_ORG: ${INFLUXDB_ORG:-my-org}
INFLUXDB_BUCKET: ${INFLUXDB_BUCKET:-telegraf}
restart: always
healthcheck:
test:
[
"CMD",
"telegraf",
"--config-directory",
"/etc/telegraf/telegraf.d",
"--test",
]
interval: 10s
timeout: 5s
retries: 3
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
environment:
GF_AUTH_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_AUTH_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-grafana}
GF_AUTH_ANONYMOUS_ENABLED: ${GRAFANA_ANONYMOUS_ENABLED:-false}
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning # For automated setup
depends_on:
- influxdb
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/login"]
interval: 10s
timeout: 5s
retries: 3
volumes:
influxdb_data:
grafana_data: