version: '3.2'

networks:
  subnet:

services:

  nginx:
    image: nginx:stable-alpine
    container_name: nginx_moderna
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./src/fe:/var/www/fe:ro,cached
      - ./src/be:/var/www/html:ro,cached
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ./cert/current:/var/cert
    depends_on:
      - php
    networks:
      - subnet

  mysql:
    image: mysql:5.7
    command: --default-authentication-plugin=mysql_native_password
    container_name: mysql_moderna
    #platform: linux/amd64
    tty: true
#    ports:
#      - "4307:3306"
    environment:
      MYSQL_DATABASE: homestead
      MYSQL_USER: homestead
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: secret
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    volumes:
      - ./mysql/data:/var/lib/mysql
      - ./mysql/logs:/var/log/mysql
      - ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
    networks:
      - subnet

  php:
    build:
      context: .
      dockerfile: ./dockerfiles/php74
    container_name: php_moderna
    volumes:
      - ./src/be:/var/www/html:cached
      - ./settings/upload.ini:/usr/local/etc/php/conf.d/docker-php-ext-upload.ini
    networks:
      - subnet