services:
    mirotalkwebrtc:
        image: mirotalk/webrtc:latest
        container_name: mirotalkwebrtc
        hostname: mirotalkwebrtc
        volumes:
            - .env:/src/.env:ro
            - ./backend/config.js:/src/backend/config.js:ro
            # Optional volumes for real-time updates:
            # - ./backend/:/src/backend/:ro
            # - ./frontend/:/src/frontend/:ro
        restart: unless-stopped
        ports:
            - '${SERVER_PORT}:${SERVER_PORT}'
        links:
            - mongodb

    mongodb:
        image: mongo:latest
        container_name: mirotalkmongodb
        restart: unless-stopped
        environment:
            MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
            MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
            MONGO_INITDB_DATABASE: ${MONGO_DATABASE}
        ports:
            - '${MONGO_PORT}:${MONGO_PORT}'
        volumes:
            - './.mongodb_data:/data/db'
        command: mongod --quiet --logpath /dev/null

volumes:
    mongodb_data:
        driver: local
