# ====== CONFIGURE PORTS MANUALLY ======
# PHP/Apache: 1035 (host) → 80 (container)
# MySQL: 3319 (host) → 3306 (container)
# phpMyAdmin: 8019 (host) → 80 (container)

services:
  php-fpm:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: gold-pages-php
    volumes:
      - ./web:/var/www/html
      - ./php.ini:/usr/local/etc/php/conf.d/custom.ini
    networks:
      - gold-pages-network

  nginx:
    image: nginx:latest
    container_name: gold-pages-nginx
    ports:
      - "1035:80"            # Host:Container (change 1035 if needed)   # Access site at http://localhost:1035
    volumes:
      - ./web:/var/www/html
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php-fpm
    networks:
      - gold-pages-network

  mysql:
    image: mysql:8.0
    container_name: gold-pages-mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: rootpass
      MYSQL_DATABASE: gold_pages_db
      MYSQL_USER: gold_pages_user
      MYSQL_PASSWORD: gold_pages_pass
    ports:
      - "3319:3306"          # Host:Container (change 3319 if needed)
    volumes:
      - db_data:/var/lib/mysql
    networks:
      - gold-pages-network

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: gold-pages-phpmyadmin
    restart: always
    ports:
      - "8019:80"            # Host:Container (change 8019 if needed)   # Access phpmyadmin at http://localhost:8019
    environment:
      PMA_HOST: mysql
      PMA_USER: gold_pages_user
      PMA_PASSWORD: gold_pages_pass
      PMA_PORT: 3306
    depends_on:
      - mysql
    networks:
      - gold-pages-network

networks:
  gold-pages-network:

volumes:
  db_data:
