version: '3.9'

services:
  nginx:
    extends:
      file: docker-compose.base.yml
      service: nginx
    networks:
      default:
        aliases:
          - loc.yoursite.ru
  php73:
    extends:
      file: docker-compose.base.yml
      service: php
    build:
      dockerfile: php73.Dockerfile
  php74:
    extends:
      file: docker-compose.base.yml
      service: php
    build:
      dockerfile: php74.Dockerfile
  php81:
    extends:
      file: docker-compose.base.yml
      service: php
    build:
      dockerfile: php81.Dockerfile
  workspace73:
    extends:
      file: docker-compose.base.yml
      service: workspace
    build:
      dockerfile: workspace73.Dockerfile
    secrets:
      - user_ssh_key
      - user_known_hosts
      - composer_auth1
  workspace74:
    extends:
      file: docker-compose.base.yml
      service: workspace
    build:
      dockerfile: workspace74.Dockerfile
    secrets:
      - user_ssh_key
      - user_known_hosts
      - composer_auth1
  workspace81:
    extends:
      file: docker-compose.base.yml
      service: workspace
    build:
      dockerfile: workspace81.Dockerfile
  inbucket:
    extends:
      file: docker-compose.base.yml
      service: inbucket
  db:
    extends:
      file: docker-compose.base.yml
      service: db
    volumes:
      - database:/var/lib/mysql
      - ./hostfiles:/hostfiles
  pma:
    extends:
      file: docker-compose.base.yml
      service: pma
  redis:
    extends:
      file: docker-compose.base.yml
      service: redis
  redis-some:
    extends:
      file: docker-compose.base.yml
      service: redis

volumes:
  database:

secrets:
  user_ssh_key:
    file: ~/.ssh/id_rsa
  user_known_hosts:
    file: ~/.ssh/known_hosts
  composer1_auth:
    file: ~/.composer/auth.json
  composer2_auth:
    file: ~/.config/composer/auth.json