services:
  db:
    image: mariadb:latest
    restart: always
    ports:
      - 3306:3306
    environment:
      MYSQL_ROOT_PASSWORD: 'test'
      MYSQL_DATABASE: 'test'
      MYSQL_USER: 'test'
      MYSQL_PASSWORD: 'test'
    volumes:
      - ./data/db:/var/lib/mysql
    networks:
      - internal
    deploy:
      resources:
        limits:
          memory: 2048m

networks:
  internal:
    driver: bridge
