version: '3'

services:
    koillection:
        image: koillection/koillection
        container_name: koillection
        restart: unless-stopped
        expose:
            - 80
            - 443
        ports:
            - "8001:80"
        environment:
            - VIRTUAL_HOST=catalogue.bengoldsworthy.net
            - LETSENCRYPT_HOST=catalogue.bengoldsworthy.net
            - DB_DRIVER=pdo_pgsql
            - DB_NAME=koillection
            - DB_HOST=db
            - DB_PORT=5432
            - DB_USER=root
            - DB_PASSWORD=root
            - DB_VERSION=12.2
            - PHP_TZ=Europe/Paris
            - HTTPS_ENABLED=1
        depends_on:
            - db
        volumes:
            - ./conf:/conf
            - ./uploads:/uploads

    db:
        image: postgres:latest
        container_name: db
        restart: unless-stopped
        environment:
            - POSTGRES_DB=koillection
            - POSTGRES_USER=root
            - POSTGRES_PASSWORD=root
        volumes:
            - "./volumes/postgresql:/var/lib/postgresql/data"

networks:
    default:
        external:
            name: nginx-proxy
