version: '3'
services:
    market-server:
        image: 'market-market-server'
        container_name: 'market-server'
        restart: always
        working_dir: /app
        volumes:
            - './volume/market/key:/app/src/sign/key'
            - './volume/market/files:/app/files'
#            - '../files:/app/files'
        environment:
            - HOST_URI=http://update.hotel.moovi-iptv.ru
            - MONGODB_URI=mongodb://mongodb-market:27017/market
            - TZ=Europe/Moscow
            - UID=1000
            - GID=1000
        # command: ["./wait-for", "mongodb-market:27017", "--", "/app/node_modules/nodemon/bin/nodemon.js", "./src/server.js"]
        command: ["./wait-for", "mongodb-market:27017", "--", "node", "./src/server.js"]

        logging:
            driver: "json-file"
            options:
                max-size: "1m"
                max-file: "3"
        depends_on:
            - mongodb-market
    market-admin:
        image: 'market_market-admin'
        container_name: "market-admin"
        volumes:
            - './nginx-conf:/etc/nginx/conf.d'
            - './volume/market/files:/usr/share/nginx/html/files'
#            - '../files:/app/files'
            - './volume/market/key.pub:/usr/share/nginx/html/key.pub'
        restart: always
        ports:
            - '8090:80'
    mongodb-market:
        image: "mvertes/alpine-mongo"
        container_name: 'mongodb-market'
        restart: always
        volumes:
            - './volume/market/database:/data/db'
        environment:
            - TZ=Europe/Moscow
            - UID=1000
            - GID=1000

        logging:
            driver: "json-file"
            options:
                max-size: "1m"
                max-file: "3"
