version: "3.7"

networks:
  leis-net:
    driver: bridge

services:
  db:
    container_name: leis-mysql
    image: mysql:5.7
    restart: always
    networks:
      - leis-net
    volumes:
      - leis-database-data:/var/lib/mysql
    ports:
      - 3307:3306
    environment:
      - MYSQL_ROOT_PASSWORD=mklider
      - MYSQL_DATABASE=leis
      - MYSQL_USER=leis
      - MYSQL_PASSWORD=leis
    extra_hosts:
      - "host.docker.internal:172.18.0.1"
      - "host.docker.internal:172.18.0.3"

  website-rails:
    build: .
    ports:
      - "3000:3000"
    networks:
      - leis-net
    volumes:
      - ".:/app"
    links:
      - db
    extra_hosts:
      - "host.docker.internal:172.18.0.1"
      - "host.docker.internal:172.18.0.3"

volumes:
  leis-database-data:
