version: '3.3'

services:
  leantime_db:
    image: mysql:8.4
    container_name: mysql_leantime
    volumes:
      - db_data:/var/lib/mysql
    restart: unless-stopped
    env_file: ./.env                                        # Environment file with settings
    networks:
      - leantime-net
    command: --character-set-server=UTF8MB4 --collation-server=UTF8MB4_unicode_ci

  leantime:
    image: leantime/leantime:latest
    container_name: leantime
    restart: unless-stopped
    env_file: ./.env                                        # Environment file with settings
    networks:
      - leantime-net
    volumes:
      - public_userfiles:/var/www/html/public/userfiles     # Volume to store public files, logo etc
      - userfiles:/var/www/html/userfiles                   # Volume to store private user uploaded files
      - plugins:/var/www/html/app/Plugins                   # Uncomment if you are planning to use plugins from the marketplace
    ports:
      - "${LEAN_PORT}:80"                                          # The port to expose and access Leantime
    depends_on:
      - leantime_db                                         # Don't start Leantime unless leantime_db is running

volumes:
  db_data:
  userfiles:
  public_userfiles:
  plugins:

networks:
  leantime-net:
