services:
  wordpress:
    image: wordpress:6.8.2
    container_name: ${CONTAINER_NAME}
    ports:
      -  ${PANEL_APP_PORT_HTTP}:80
    restart: always
    networks:
      - icontainer-network
    volumes:
      - ./data:/var/www/html
      - ./conf/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
    environment:
      WORDPRESS_DB_HOST: ${PANEL_DB_HOST}:${PANEL_DB_PORT}
      WORDPRESS_DB_NAME: ${PANEL_DB_NAME}
      WORDPRESS_DB_USER: ${PANEL_DB_USER}
      WORDPRESS_DB_PASSWORD: ${PANEL_DB_USER_PASSWORD}
      APACHE_RUN_USER: icontainer
      APACHE_RUN_GROUP: icontainer
      WORDPRESS_DEBUG: 0
    entrypoint:
      - bash
      - -ec
      - |
        # if not exists
        getent group icontainer     || groupadd -g 1000 icontainer
        id -u icontainer            || useradd -u 1000 -g icontainer -m -s /bin/bash icontainer
        # call entrypoint with CMD
        exec docker-entrypoint.sh apache2-foreground
    labels:
      createdBy: "icontainer"
networks:
  icontainer-network:
    external: true