version: '3.3'
services:
  nginx:
    build:
      context: ../../dockerfiles/nginx
      dockerfile: Dockerfile
    command: sh /home/scripts/start.sh
    volumes:
      - ../nginx/nginx_config_dev.conf:/etc/nginx/conf.d/default.conf
      - ../../app:/var/www/html
      - ../scripts/nginx:/home/scripts
      - ../../letsencrypt:/etc/letsencrypt
    ports:
      - 80:80
      - 8090:8090
      - 443:443
    working_dir: /var/www/html
  php:
    build:
      context: ../../dockerfiles/php
      dockerfile: Dockerfile_ubuntu
    volumes:
      - ../../app:/var/www/html
      - ../scripts/php:/home/scripts
    ports:
      - 9002:9002
    command: sh /home/scripts/start.sh
  workspace:
    build:
      context: ../../dockerfiles/php
      dockerfile: Dockerfile_ubuntu
    volumes:
      - ../../app:/var/www/html
      - ../../shortcats:/var/www
      - ../scripts/php:/home/scripts
    working_dir: /var/www/html
    command: sh /home/scripts/workspace.sh
  db:
    build:
      context: ../../dockerfiles/mysql
      dockerfile: Dockerfile
    volumes:
      - ../../data/mysql:/var/lib/mysql
      - ../../dumps:/home/dumps
      - ../scripts/mysql:/home/scripts
    ports:
      - 3306:3306
    restart: unless-stopped
    working_dir: /home
    command: sh /home/scripts/start.sh
  mailcatcher:
    # restart: on-failure
    image: dockage/mailcatcher:0.9.0
    ports:
    - "1080:1080"
    - "1025:1025"
  adminer:
    image: adminer
    restart: always
    ports:
        - 8080:8080
  nodejs:
    build:
      context: ../../dockerfiles/nodejs
      dockerfile: Dockerfile
    volumes:
      - ../scripts/nodejs:/home/scripts
      - ../../app:/home/app
    working_dir: /home/app
    command: sh /home/scripts/start.sh
networks:
  default:
    external:
      name: dockernet