# author oas Ohotnikov.A@artix.su
# Запускаем 3 сервиса: DB, delivery, gateway
version: '3'
services:
  delivery-db:
    image: postgres:10.6
    restart: always
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: delivery
      POSTGRES_DB: delivery
    container_name: delivery-db
    volumes:
      - delivery_postgres_data:/var/lib/postgresql/data
      - delivery_postgres_logs:/logs:z
  delivery-service:
    image: cashserver.artix.su:1443/delivery-service:${TAG:-latest}
    restart: always
    ports:
      - "8110:8110"
    depends_on:
      - delivery-db
    network_mode: "host"
    volumes:
      - delivery_logs:/logs
    container_name: delivery-service
  delivery-gateway:
    image: cashserver.artix.su:1443/delivery-gateway:${TAG:-latest}
    restart: always
    ports:
      - "8111:8111"
    depends_on:
      - delivery-db
      - delivery-service
    command: ["./wait-for.sh", "-t", "100", "delivery-service"]
    network_mode: "host"
    container_name: delivery-gateway
    volumes:
      - delivery_logs:/logs
volumes:
  delivery_postgres_data:
  delivery_postgres_logs:
  delivery_logs: