services:
  database:
    image: mysql:8.0
    ports:
      - "3306:3306"
    environment:
      MYSQL_DATABASE: cashier_assistant
      MYSQL_USER: cashier
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: rootsecret
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uroot", "-prootsecret"]
      timeout: 5s
      retries: 10
      start_period: 30s
    volumes:
      - database_data:/var/lib/mysql:rw

volumes:
  database_data:
