Issue With Docker Compose and Influx2.0.0 Not Writing

I am trying to create a docker compose network to run some experiments with joining time series data with meta data from a MySQL table. The thing I am running into is that I set up the compose file, boot it up and each time I have to reconfigure the login logic on the web gui. Additionally, I see issues trying to add line protocol data. I add the data which is manually typed, the message says that it was added successfully, but then it does not show up in data explorer.

I checked the MySQL container and it is persisting data after stopping the network and booting it back up. From what I can see it looks like I am having issues with the influx container. Here is my docker file:

version: '3'

services:
  influx:
image: quay.io/influxdb/influxdb:2.0.0-rc
container_name: influxdb
ports:
  - 8086:8086
volumes: 
 - C:\Dev\InfluxTesting\InfluxMySqlDocker\data\my-influxdb:/var/lib/influxdb
  
  mysql:
image: mysql:latest
container_name: mysqldb
command: --default-authentication-plugin=mysql_native_password
environment:
  MYSQL_ROOT_PASSWORD: root
  MYSQL_DATABASE: influx_test_db
ports:
 - "3307:3306"
volumes:
 - C:\Dev\InfluxTesting\InfluxMySqlDocker\data\my-mysqldb:/var/lib/mysql

I am using the influx 2.0.0-rc so I don’t know if that might be contributing. Any help would be appreciated.

Edit:
Just to update, the test data is writing. The issue still remains where I need to set up the account each time I run docker-compose up and the data is not there when I do. So the issue does seem to be that we are not persisting data from one session into another.

Hello @georgeoffley,
Can you try this?

version: '3'
services:
  influx:
    image: quay.io/influxdb/influxdb:2.0.0-rc
    container_name: influxdb
    ports:
      - 8086:8086
    volumes: 
    - /tmp/testdata/influx:/root/.influxdbv2
  mysql:
    image: mysql:latest
    container_name: mysqldb
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: influx_test_db
    ports:
    - "3307:3306"
    volumes:
    - /tmp/testdata/sql:/var/lib/mysql

I believe the issue is located around their volume mount. InfluxDBv2 uses a path of /root/.influxdbv2/ for the bolt database and storage path. The user is expecting the database to use /var/lib/influxdb which it doesn’t by default. You can change their volume mount from /var/lib/influxdb to /root/.influxdbv2 and that should remove the need to run setup each time. Another option would be to set these arguments to a user defined path: --bolt-path and --engine-path

We actually came across that exact fix this morning. It does not seem to be in any docs that we could find pertaining to running Influx via docker. Thanks a lot for your reply.