version: '3'

services:
    # Koillection
    koillection:
        image: koillection/koillection
        container_name: koillection
        restart: unless-stopped
        ports:
            - 80:80
        depends_on:
            - db
        volumes:
            - ./volumes/koillection/uploads:/uploads

    # Database : choose one of the following
    db:
        image: postgres:16
        container_name: db
        restart: unless-stopped
        environment:
            - POSTGRES_DB=${DB_NAME}
            - POSTGRES_USER=${DB_USER}
            - POSTGRES_PASSWORD=${DB_PASSWORD}
        volumes:
            - "./volumes/postgresql:/var/lib/postgresql/data"

    #db:
    #    image: mysql:latest
    #    container_name: db       
    #    restart: unless-stopped 
    #    environment:
    #        - MYSQL_DATABASE=${DB_NAME}
    #        - MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
    #    volumes:
    #        - "./docker/volumes/mysql:/var/lib/mysql"