services:
  mysql:
    image: mysql:8.0.36-debian
    ports:
      - "3306:3306"
    env_file:
      - ./.configs/mysql/.env
    networks:
      - asistencia-backend

  django:
    build: .
    command: python manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/usr/src/app/
      - django_data_flags:/usr/src/app/.data/flags
      - django_static_files:/usr/src/app/static/
      - django_media_files:/usr/src/app/media/
    ports:
      - "8000:8000"
    environment:
      - CONTAINER=development
      - STAGE=development
      - DEBUG=True
      - ENV_SECRETS_DEBUG=true
      - LOGLEVEL=debug
      - ASK_CONFIRMATION_EMAIL=True
      - DATABASE=mysql
      - SQL_HOST_TEST=mysql
      - SQL_PORT_TEST=3306
      - CONFIG_FILE=development.json
    env_file:
      - ./.configs/django/.env
    depends_on:
      - mysql
    networks:
      - asistencia-backend
      - asistencia-frontend

volumes:
  django_data_flags: {}
  django_static_files: {}
  django_media_files: {}

networks:
  asistencia-backend:
  asistencia-frontend:
