version: '3.8'

services:
  admin-web:
    image: kaii-admin-web:${IMAGE_TAG}
    container_name: kaii-admin-web
    build:
      context: .
    environment:
      - DATABASE_URL=mysql://root:changeit@mysqldb:3306/kaii
      - NEXTAUTH_URL=${NEXTAUTH_URL}
      - NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
    ports:
      - 3000:3000
    networks:
      - admin-web

  mysqldb:
    image: mysql:8.0
    cap_add:
      - SYS_NICE
    restart: always
    environment:
      - MYSQL_DATABASE=kaii
      - MYSQL_ROOT_PASSWORD=changeit
    ports:
      - 3306:3306
    networks:
      - admin-web
    volumes:
      - db:/var/lib/mysql

volumes:
  db:

networks:
  admin-web: