#
# GENERATED BY docker/init.sh - template: ./templates/docker-compose.yml - 97c88229bd2b5099544c013052b8d9c3
#
# ======================================================================
#
# (1) see .env for set variables
# (2) run "docker-compose up" to startup
# 
# ======================================================================
version: '3.9'

networks:
  imlcinode-network:

services:

  # ----- apache httpd + php
  imlcinode-web-server:

    build:
      context: .
      dockerfile: ./containers/web-server/Dockerfile
    
    # keep "FROM" in docker file ... then image is not needed here
    # image: "php:8.1-apache"

    container_name: 'imlcinode-server'
    ports:
      - '${APP_PORT}:80'

    working_dir: ${WEBROOT}
    
    volumes:
      # service config
      - ./containers/web-server/apache/sites-enabled:/etc/apache2/sites-enabled
      - ./containers/web-server/php/extra-php-config.ini:/usr/local/etc/php/conf.d/extra-php-config.ini

      # data dirs
      - ../data/.ssh:/var/www/.ssh
      - ../data/imldeployment:/var/imldeployment
      - ../data/tmp:/var/tmp/imldeployment

      # app webroot
      - ../:/var/www/${APP_NAME}

    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost"]
      interval: 10s
      timeout: 3s
      retries: 5
      # start_period: 40s

    networks:
      - imlcinode-network

    user: ${DOCKER_USER_UID}

