name: databases

volumes:
  mysql8:
  cockroachdb:
  firebird:


services:
  mysql8:
    container_name: mysql8
    image: mysql:8.0.21
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example
      MYSQL_DATABASE: test
    ports:
      - 3308:3306
    volumes:
      - mysql8:/var/lib/mysql
      - ./dev/docker_mysql_init:/docker-entrypoint-initdb.d
    networks:
      - proxy
  cockroachdb:
    container_name: cockroachdb
    image: cockroachdb/cockroach:v22.1.1
    volumes:
      - cockroachdb:/cockroach/cockroach-data
    ports:
      - 26257:26257
    command: start-single-node --insecure
    networks:
      - proxy
  # use keyspace; describe tables; # get all the tables for a specific keyspace
  # select * from system_schema.keyspaces; # gets all keyspaces
  # https://www.folkstalk.com/2022/09/get-all-keyspaces-in-cassandra-with-code-examples.html
  # Create keyspace https://www.tutorialspoint.com/cassandra/cassandra_create_keyspace.htm
  firebird:
    container_name: firebird
    image: jacobalberty/firebird:v4.0.1
    volumes:
      - ./dev/docker_firebird:/docker_init
    ports:
      - 3050:3050
    environment:
      - ISC_PASSWORD=masterkey
      - EnableLegacyClientAuth=true
    command: sh -c 'chmod +x /docker_init/entrypoint.sh; /docker_init/entrypoint.sh & /usr/local/firebird/docker-entrypoint.sh firebird;'
    networks:
      - proxy
  libsql:
    container_name: libsql
    image: ghcr.io/tursodatabase/libsql-server:latest
    platform: linux/amd64
    ports:
      - 8098:8080
      - 5001:5001
      # environment:
      #   - SQLD_NODE=primary
      # volumes:
      #   - ./dev/docker_libsql:/var/lib/sqld
    networks:
      - proxy

networks:
  proxy:
    external: true
