version: "2"
services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./tls-certs:/etc/nginx/certs
      - ./dist/nginx-proxy.conf:/etc/nginx/conf.d/proxy.conf
    environment:
      DEFAULT_HOST: 127.0.0.1.xip.io
  ushahidi:
    build: .
    command: run
    volumes:
      - .tars:/tars
    links:
      - mysql
      - redis
    ports:
      - "80"
    environment:
      VIRTUAL_HOST: 127.0.0.1.xip.io
      MYSQL_HOST: mysql
      MYSQL_DATABASE: ushahidi
      MYSQL_USER: ushahidi
      MYSQL_PASSWORD: ushahidi
      REDIS_HOST: redis
      REDIS_PORT: "6379"
      CACHE_DRIVER: redis
      # Setting this variable is required for the mobile app to work:
      # SITE_URL: http://127.0.0.1.xip.io
  mysql:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: ushahidi
      MYSQL_USER: ushahidi
      MYSQL_PASSWORD: ushahidi
  redis:
    image: redis:4-alpine
