version: "3.7"
services:
    wallet:
        image: hiveio/wallet:latest
        deploy:
            mode: replicated
            replicas: 2
            resources:
                limits:
                    cpus: "0.85"
                    memory: 2024M
            restart_policy:
                condition: any
                delay: 5s
            update_config:
                parallelism: 1
                delay: 10s
                failure_action: rollback
                order: start-first
            rollback_config:
                parallelism: 1
                delay: 5s
        environment:
            VIRTUAL_HOST: wallet.hive.blog
            VIRTUAL_PORT: 8080
            SDC_DATABASE_URL: mysql://root:mysecret@mysql/hive_wallet
            SDC_CLIENT_HIVED_URL: https://anyx.io
            SDC_SERVER_HIVED_URL: https://anyx.io
            SDC_DISABLE_SIGNUPS: 1
            SDC_SITE_DOMAIN: wallet.hive.blog
            SDC_IMAGE_PROXY_PREFIX: https://images.hive.blog/
            SDC_UPLOAD_IMAGE_URL: https://images.hive.blog
            SDC_ALT_API_ENDPOINTS: "https://api.hive.blog https://anyx.io https://api.openhive.network https://api.hivekings.com"
            SDC_HELMET_CONNECTSRC: "'self' https://wallet.hive.blog https://images.hive.blog https://api.hive.blog https://anyx.io https://api.openhive.network https://api.hivekings.com"
            WALLET_URL: https://wallet.hive.blog
        networks:
            - reverse-proxy
            - database

    mysql:
        image: mysql:5.7
        volumes:
            - db_mysql:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: mysecret
            MYSQL_DATABASE: hive_wallet
            MYSQL_USER: root
            MYSQL_PASSWORD: mysecret
        networks:
            - database
        deploy:
            mode: replicated
            replicas: 1
            resources:
                limits:
                    cpus: "0.85"
                    memory: 2024M

volumes:
    db_mysql:

networks:
    database:
    reverse-proxy:
        external: true
