version: '2'

services:
  wordpress:
    image: wordpress:5.0.2-php7.1-fpm
    depends_on:
      - db
    links:
      - db
    volumes:
      - ../WWW_DATA:/var/www/html
      - ../configs/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
    env_file:
      - database.env
    restart: unless-stopped
    mem_limit: 512M
    container_name: wp_hr_web
  nginx:
      image: nginx:latest
      ports:
          - '30070:80'
      volumes:
          - ../nginx:/etc/nginx/conf.d
          - ../logs/nginx:/var/log/nginx
          - ../WWW_DATA:/var/www/html
      links:
          - wordpress
      restart: unless-stopped
      container_name: wp_hr_nginx
  db:
    image: mariadb
    volumes:
      - ../SQL_DATA:/var/lib/mysql
    env_file:
      - database.env
    restart: unless-stopped
    mem_limit: 256M
    container_name: wp_hr_db
#  cron:
#     build:
#       context: ../BACKUP
#     hostname: mail.vqode.com
#     depends_on:
#       - db
#       - wordpress
#     links:
#       - db
#     volumes:
#       - ./WWW_DATA:/var/www/html
#     env_file:
#       - database.env
#     restart: unless-stopped
#     container_name: wp_hr_backup_service
  # sftp:
  #   image: atmoz/sftp
  #   volumes:
  #       - /Users/ali/Desktop:/home/foo/
  #   ports:
  #       - "2222:22"
  #   command: foo:123:501:20
  #   restart: unless-stopped
  #   container_name: wp_template_sshd_service
