Hi there,
first of all I am new in the matter.
I have a docker-compse.yml to start all the backend stuff like InfuxDB Grafana and so on.
version: '3.7'
services:
influxdb:
image: influxdb:latest
container_name: influxdb
ports:
- 8086:8086
volumes:
# Data persistency
- ./vol/influxFol:/var/lib/influxdb:rw
#- /mnt/mydisk/Persistence/influxFol:/var/lib/influxdb:rw
environment:
- INFLUXDB_DB=metrics # Automatically initializes a database with the name of this environment variable
- INFLUXDB_REPORTING_DISABLED=true
- INFLUXDB_ADMIN_USER=influx_admin
- INFLUXDB_ADMIN_PASSWORD=some_password
- INFLUXDB_HTTP_LOG_ENABLED=false
- INFLUXDB_DATA_QUERY_LOG_ENABLED=false
# The name of a user to be created with no privileges.
- INFLUXDB_USER=collector # If INFLUXDB_DB is set, this user will be granted read and write permissions for that database
- INFLUXDB_USER_PASSWORD=some_password.
restart: always
deploy:
resources:
limits:
memory: 500M
Now i start a python3 script to write datas into the influxDB by the official python InfluxDB-Client.
This works fine!
So i build a docker image and run this image in a docker-compose.yml. But when i do this, i canât write into the database ? hm, why?
here is the Docker build file
FROM python:alpine3.9
COPY . /app
WORKDIR /app
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
and the docker-compose.yml
version: '3.7'
services:
writeToDB:
image: writeToDB:latest
container_name: writeToDB
build:
context: .
args:
- buildno=latest
command: python3 runnerMain.py
volumes:
- .:/app:rw
restart: always
deploy:
resources:
limits:
memory: 200M
volumes:
files: {}
I have tried to connect to the InfluxDB host by his IP 127.0.0.1 or as localhost, for all this i canât write datas to the DB.