version: '3.3'

services:
  smssender:
    image: registry.gitlab.com/samarasoft/samarasoft.smssender.2.0/master
    environment:
      ASPNETCORE_URLS: "http://*:5000"
      DB_HOST: postgres
      DB_PORT: 5432
      DB_NAME: sms_sender
      DB_USER: admin
      DB_PASSWORD: password
      RMQ_HOST: rabbitmq
      RMQ_USER: admin
      RMQ_PASSWORD: password
      RMQ_QUEUE_SMS: SmsSender
      RMQ_QUEUE_PROVIDER_STATUS_CHANGE: SmsProviderStatusChanged
      RMQ_QUEUE_SMS_STATUS_CHANGED: SmsStatusChanged
      API_AUTH_TOKEN: secret
    restart: on-failure
    ports:
      - "5000:5000"
    labels:
      NAME: "smssender"
    depends_on:
      - rabbitmq
      - postgres
    networks:
      - mynetwork

  rabbitmq:
    image: rabbitmq:3-management
    hostname: rabbitmq
    environment:
      RABBITMQ_DEFAULT_USER: "admin"
      RABBITMQ_DEFAULT_PASS: "password"
      RABBITMQ_DEFAULT_VHOST: "/"
    ports:
      - "15672:15672"
      - "5672:5672"
    labels:
      NAME: "rabbitmq"
    networks:
      - mynetwork

  postgres:
    image: postgres:11
    environment:
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: password
      POSTGRES_DB: sms_sender
    volumes:
       - pgdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    labels:
      NAME: "postgres"
    networks:
      - mynetwork
volumes:
  pgdata:

networks:
  mynetwork: