version: "3.8"
networks:
  sparx-network:
    # Use a custom driver
    driver: bridge
services:
  # lumen rest api
  restapi:
    hostname: lumen.host
    # Path to dockerfile.
    #build: .
    image: rksptl/php7.4-apache:latest
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 2G
    ports:
      - "8080:80"
    volumes:
      - "/var/www/html/SIS970-API:/var/www/html"
    environment:
        #app config
        APP_TIMEZONE: UTC
        APP_NAME: 'SIS970-API'
        APP_ENV: 'local'
        APP_KEY: 'base64:EPi8u+veGS8ZTY+c8mnL80eJlFOfIFS9fijcxwP3Hjc='
        APP_DEBUG: 'true'
        APP_URL: 'http://localhost'
        FRONT_END: 'http://localhost'
        #db config
        DB_CONNECTION: 'mysql'
        DB_HOST: 'db'
        DB_PORT: '3306'
        DB_DATABASE: 'SIS970'
        DB_USERNAME: 'root'
        DB_PASSWORD: 'admin@123'
        #smtp mail credentials
        MAIL_DRIVER: smtp
        MAIL_FROM_ADDRESS: 'erp.quantum@gmail.com'
        MAIL_HOST: 'smtp.gmail.com'
        MAIL_PORT: '587'
        MAIL_USERNAME: 'erp.quantum@gmail.com'
        MAIL_PASSWORD: 'yyqypcpnyrjqeqkr'
        MAIL_ENCRYPTION: 'tls'
        #cache credentials
        CACHE_DRIVER: file
        QUEUE_CONNECTION: sync
        MEMCACHED_HOST: '127.0.0.1'
        REDIS_HOST: redis-host
        REDIS_PASSWORD: ''
        REDIS_PORT: '6379'
        #aws credentials
        AWS_ACCESS_KEY_ID: ''
        AWS_SECRET_ACCESS_KEY: ''
        AWS_DEFAULT_REGION: 'us-east-1'
        AWS_BUCKET: ''
        #log
        LOG_CHANNEL: stack
        LOG_SLACK_WEBHOOK_URL: ''
        #google
        GOOGLE_PLACES_API: 'AIzaSyCyMQNjWRHZLsf2Y_gsIAmGJl9T7K9-Vec'

    depends_on:
      - db
      - redis
    networks:
      - sparx-network
  # mariadb database
  db:
    #restart: always
    image: mariadb
    hostname: db-host
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 2G
    ports:
      - "3306:3306"
    environment:
      - "MYSQL_ROOT_PASSWORD=admin@123"      
    volumes:
      - "/mnt/mariadb:/var/lib/mysql"
    networks:
      - sparx-network
  # redis cache
  redis:
    #restart: always
    image: redis
    hostname: redis-host
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 2G
    #ports:
     # - "6379:6379"
    networks:
      - sparx-network
  # mariadb ui
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 2G
    depends_on: 
      - db
    ports:
      - 9090:80
    environment:
        MYSQL_ROOT_PASSWORD: admin@123
        UPLOAD_LIMIT: 512M
    networks:
      - sparx-network  
