#This docker-compose file is provided for dev purposes
version: '3'

services:
    #FPM image
    koillection:
        container_name: koillection
        image: docker.pkg.github.com/koillection/koillection/fpm:dev
        restart: always
        ports:
            - 80:80
        environment:
            - APP_ENV=dev
            - APP_DEBUG=1
            - DB_DRIVER=pdo_mysql
            - DB_NAME=koillection
            - DB_HOST=mysql
            - DB_PORT=3306
            - DB_USER=root
            - DB_PASSWORD=m6iFpZTkR1U6klSvLtRF
            - DB_VERSION=8
            - PHP_TZ=Europe/Paris
        depends_on:
            - mysql
            - postgres
        volumes:
            - "./docker/volumes/koillection/public/uploads:/var/www/koillection/public/uploads"
            - ./:/var/www/koillection
        dns: 1.1.1.1

    postgres:
        container_name: postgres
        image: postgres:latest
        environment:
            - POSTGRES_DB=koillection
            - POSTGRES_USER=root
            - POSTGRES_PASSWORD=m6iFpZTkR1U6klSvLtRF
            - POSTGRES_HOST_AUTH_METHOD=trust
        ports:
            - 5432:5432
        volumes:
            - "./docker/volumes/postgresql:/var/lib/postgresql/data"

    mysql:
        container_name: mysql
        image: mysql:latest
        environment:
            - MYSQL_ROOT_PASSWORD=m6iFpZTkR1U6klSvLtRF
            - MYSQL_DATABASE=koillection
            - MYSQL_USER=root
        ports:
            - 3306:3306
        volumes:
            - "./docker/volumes/mysql:/var/lib/mysql"

    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        ports:
            - "8080:80"
        links:
            - mysql
        environment:
            - PMA_HOST=mysql