name: xkater

services:
  db:
    image: mysql:8.0
    container_name: xkater-db
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
    volumes:
      - db_data:/var/lib/mysql

  wordpress:
    image: wordpress:php8.2-apache
    container_name: xkater-wp
    restart: unless-stopped
    depends_on:
      - db
    ports:
      - '${WORDPRESS_PORT}:80'
    environment:
      WORDPRESS_DB_HOST: ${WORDPRESS_DB_HOST}
      WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME}
      WORDPRESS_DB_USER: ${WORDPRESS_DB_USER}
      WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
      WORDPRESS_TABLE_PREFIX: ${WORDPRESS_TABLE_PREFIX}
      WORDPRESS_DEBUG: ${WORDPRESS_DEBUG}
      WORDPRESS_CONFIG_EXTRA: |
        define('WP_ENVIRONMENT_TYPE', 'local');
        define('WP_DEBUG_DISPLAY', false);
        @ini_set('display_errors', 0);
    volumes:
      - ./wp-content:/var/www/html/wp-content
      - ./docker/php/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini

volumes:
  db_data:
