3

I have two docker-compose files. In one is mariadb in another superset

mariadb:

version: '2.4'

services:
  mariadb:
    container_name: mariadb
    image: mariadb
    restart: always

    volumes:
      - ./mariadb-data:/var/lib/mysql

    environment:
      MYSQL_DATABASE: 'db_prueba'
      MYSQL_USER: 'admin'
      MYSQL_PASSWORD: 'admin'
      MARIADB_ROOT_PASSWORD: 'admin'
    ports:
      - 2022:3306

superset:

version: '2.4'
services:

  phpmyadmin:
    container_name: phpmyadmin
    image: phpmyadmin
    restart: always
    ports:
      - 7000:80
    environment:
      - PMA_ARBITRARY=1
      - MEMORY_LIMIT=-1
      - PMA_HOST=mariadb
      - MYSQL_ROOT_PASSWORD=admin
      - UPLOAD_LIMIT=100G

  supeset:
    container_name: superset
    build: .
    restart: always
    depends_on:
      - mariadb
    environment:
      MAPBOX_API_KEY: 'pk.eyJ1IjoiamFta2lsbHM1IiwiYSI6ImNrd293aDJyZjA3MGQyd3AzdTJpeXp0dTAifQ.w96chqjB6Nv3PW6_lpQVHQ'
    ports:
      - 8000:8088
    volumes:
      - ./superset-data:/var/lib/mysql
    networks:
      - mdb

networks:
  mdb:
    external:
      name: mdb_default

I made a dataset and a chart, then I did docker-compose down in supersert and then docker-compose up to get the system up, but everything I had done was deleted. I can't get the data to stay even if the container is deleted, what else can I try?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Dom Rl
  • 35
  • 1
  • 6

2 Answers2

0

Adding these two lines in my docker-compose.yml for the superset image did the trick for me.

volumes: 
    - ./superset:/app
    - ./superset/.superset:/root/.superset/
0

I found very little documentation on this either, but I tried putting /app/superset_home (as included in the docker compose file in the official repository) into a volume and the configuration survived a compose down.

It seems strange that this isn't well documented.

services:
  superset:
    image: superset
    volumes:
      - superset:/app/superset_home

volumes:
  superset:
    external: true
Matthew Walker
  • 2,527
  • 3
  • 24
  • 30