version: '3.9'

services:
  backend:
    container_name: login-page
    build: ./administration/backend
    ports:
      - "4000:4000"
    environment:
      DB_HOST: mysql
      DB_USER: root
      DB_PASSWORD: D7Ze0lwV9hMrNQHdz1Q8yi0MIQuOO8
      DB_NAME: login_page
    depends_on:
      - mysql
    volumes:
      - ./backend:/app
    restart: unless-stopped

  mysql:
    container_name: mysql-db
    image: mysql:8.0
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: D7Ze0lwV9hMrNQHdz1Q8yi0MIQuOO8
      MYSQL_DATABASE: login_page
    volumes:
      - mysql-data:/var/lib/mysql
    ports:
      - "3306:3306"

volumes:
  mysql-data:
