services:
  app:
    build: .
    container_name: colgatecny-app
    restart: unless-stopped
    tty: true
    environment:
      SERVICE_NAME: colgatecny-app
      SERVICE_TAGS: local
      APP_TIMEZONE: Asia/Singapore
      HOST_UID: 1000
      HISTSIZE: 10000
      PHP_OPCACHE_ENABLED: 0
      PHP_OPCACHE_REVALIDATE_FREQ: 0
      PHP_OPCACHE_VALIDATE_TIMESTAMPS: 1
      PHP_OPCACHE_MAX_ACCELERATED_FILES: 50000
      PHP_OPCACHE_MEMORY_CONSUMPTION: 512
      PHP_OPCACHE_MAX_WASTED_PERCENTAGE: 10
      PHP_OPCACHE_INTERNED_STRINGS_BUFFER: 128
      PHP_OPCACHE_BUFFER_SIZE: 512M
      PHP_OPCACHE_JIT: 1225
      TZ: Asia/Singapore
      SUPERVISORD_ENABLED: 1
    volumes:
      - ./project:/var/project
      - ./etc/php:/usr/local/etc/php/conf.d:default
      - ./etc/php-fpm.d:/usr/local/etc/php-fpm.d:default
      - ./etc/nginx/conf.d/:/etc/nginx/conf.d:default
      - ./etc/crontab:/etc/crontabs/root
      - ./etc/supervisor/supervisord.conf:/etc/supervisord.conf
      - ./etc/supervisor/conf.d/:/etc/supervisor/conf.d
    networks:
      - colgatecny-docker-network
    working_dir: /var/project
  web-server:
    image: nginx:alpine
    container_name: nginx
    restart: unless-stopped
    tty: true
    ports:
      - "9001:80"
    volumes:
      - ./project:/var/project
      - ./etc/nginx/conf.d/:/etc/nginx/conf.d:default
      - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf:default
    depends_on:
      - app
    networks:
      - colgatecny-docker-network

networks:
  colgatecny-docker-network:
    name: colgatecny-docker-network
    driver: bridge

