# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json
services:
    site:
        build: .
        networks:
            - am-d-model-network
        expose:
            - "3000"
        restart: unless-stopped
        labels:
            - "io.containers.autoupdate=local"

    caddy:
        image: docker.io/library/caddy:latest
        depends_on:
            - site
            - repo-web-ui
        networks:
            - am-d-model-network
        ports:
            - "80:80"
            - "443:443"
        volumes:
            - caddy_data:/data
            - ./caddy:/etc/caddy
            - static_data:/opt/invenio/var/instance/static
        restart: unless-stopped
        labels:
            - "io.containers.autoupdate=registry"
    repo-cache:
        extends:
            file: repo/docker-compose.full.yml
            service: cache
        networks:
            - am-d-model-network
    repo-db:
        extends:
            file: repo/docker-compose.full.yml
            service: db
        networks:
            - am-d-model-network
    repo-mq:
        extends:
            file: repo/docker-compose.full.yml
            service: mq
        networks:
            - am-d-model-network
    repo-search:
        extends:
            file: repo/docker-compose.full.yml
            service: search
        networks:
            - am-d-model-network
    repo-s3:
        extends:
            file: repo/docker-compose.full.yml
            service: s3
        networks:
            - am-d-model-network
    # UI Application
    repo-web-ui:
        extends:
            file: repo/docker-compose.full.yml
            service: web-ui
        build:
            context: ./repo/
        networks:
            - am-d-model-network
    # API Rest Application
    repo-web-api:
        extends:
            file: repo/docker-compose.full.yml
            service: web-api
        build:
            context: ./repo/
        networks:
            - am-d-model-network
    # Worker
    repo-worker:
        extends:
            file: repo/docker-compose.full.yml
            service: worker
        build:
            context: ./repo/
        networks:
            - am-d-model-network

networks:
    am-d-model-network:
        name: am-d-model-network

volumes:
    caddy_data:
    static_data:
    redis_data:
