services:
  # PHP
  php:
    container_name: ${APP_NAME}-php
    build:
      context: ./
      dockerfile: docker/php/php.dockerfile
    restart: always
    environment:
      ORACLE_HOME: /opt/oracle/instantclient
      LD_LIBRARY_PATH: /opt/oracle/instantclient
      TNS_ADMIN: /opt/oracle/instantclient/network/admin
    volumes:
      - ./src/:/var/www
    networks: 
      - default

  # NGINX
  nginx:
    container_name: ${APP_NAME}-nginx
    image: nginx:alpine
    restart: always
    ports:
      - "${HTTP_PORT}:80"
    # - "${HTTPS_PORT}:443"
    volumes:
      - ./docker/nginx/default.conf/:/etc/nginx/conf.d/default.conf
      - ./src/:/var/www
    # - ./docker/nginx/ssl:/etc/nginx/certs
    networks: 
      - default
    depends_on:
      - php

networks:
  default:
    name: ${NETWORK_NAME}
    driver: bridge
    ipam:
      config:
        - subnet: ${NETWORK_SUBNET}
