services:
  database:
    container_name: stockhome-mysql
    image: mysql:8.0
    ports:
      - "3306:3306"
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: stockhome
      TZ: Europe/Berlin
    volumes:
      - ./.docker/volumes/stockhome_mysql:/var/lib/mysql
      - ./mysql-timezone.cnf:/etc/mysql/conf.d/timezone.cnf:ro
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      interval: 5s
      timeout: 3s
      retries: 10