version: '3.4'

services:

  mariadb:
    image: mariadb
    restart: always
    ports:
      - 3306:3306
    #volumes:
    #  - /var/lib/mysql:/var/lib/mysql
    environment:
      - MARIADB_DATABASE=librebooking
      - MARIADB_USER=librebooking
      - MARIADB_PASSWORD=password
      - MARIADB_ROOT_PASSWORD=rootpass
    networks:
      - librebooking

  lb:
    # image: limosek/librebooking  # In production, uncomment this and remove the next line to use the stable release
    build: .
    user: 1000:1001  # Use your own UID:GID for development. In production, remove this line.
    restart: always
    depends_on:
      - mariadb
    ports:
      - 8080:80
    environment:
      - DB_USER=librebooking
      - DB_DATABASE=librebooking
      - DB_PASSWORD=password
      - DB_HOST=mariadb
      - LB_ENV=dev  # In production, remove this line
    networks:
      - librebooking
    volumes:  # In production, remove this and the next line
      - .:/var/www/librebooking

networks:
  librebooking:
