version: '3.3'

services:
    r3_db:
        container_name: r${R3_VERSION:-3.8.1}_db
        environment:
            POSTGRES_DB: ${R3_DB_NAME:-app}
            POSTGRES_USER: ${R3_DB_USER:-app}
            POSTGRES_PASSWORD: ${R3_DB_PASS:-app}
        image: postgres:latest
        restart: always
        volumes:
            - data_db:/var/lib/postgresql/data
    r3:
        build:
            context: https://github.com/r3-team/r3_docker.git#main
            args:
                r3_version: ${R3_VERSION:-3.8.1}
                r3_db_host: r3_db
                r3_db_name: ${R3_DB_NAME:-app}
                r3_db_user: ${R3_DB_USER:-app}
                r3_db_pass: ${R3_DB_PASS:-app}
                r3_os_arch: arm64
                im_policy: /etc/ImageMagick-6/policy.xml
        container_name: r${R3_VERSION:-3.8.1}_app
        image: "r3/${R3_VERSION:-3.8.1}"
        depends_on:
            - r3_db
        ports:
            - "14000:80"
        restart: always
        volumes:
            - data_app:/opt/r3/data
volumes:
    data_db:
    data_app:
