services:
  phpfpm:
    container_name: sistema_presupuestos_PHP
    restart: unless-stopped
    build:
      context: ./phpfpm
    environment:
      - TZ=Europe/Madrid
    volumes:
      - ./cron.d:/etc/cron.d
      - ./phpfpm/www.conf:/opt/bitnami/php/etc/php-fpm.d/www.conf:ro
      - ./phpfpm/common.conf:/opt/bitnami/php/etc/common.conf:ro
      - ./phpfpm/php-custom.ini:/opt/bitnami/php/etc/conf.d/php-custom.ini:ro
      - ./web:/app
    networks:
      - presupuesto-prototiposymfony-network

  nginx-public:
    image: docker.io/bitnami/nginx:latest
    container_name: sistema_presu_nginx
    restart: unless-stopped
    depends_on:
      - phpfpm
    networks:
      - presupuesto-prototiposymfony-network
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx/server-dev.conf:/opt/bitnami/nginx/conf/server_blocks/my_server_block.conf:ro
      - ./nginx/nginx.conf:/opt/bitnami/nginx/conf/nginx.conf:ro
      - ./nginx/wildcard.devel.test.crt:/opt/bitnami/certs/server.crt:ro
      - ./nginx/wildcard.devel.test.key:/opt/bitnami/certs/server.key:ro
      - ./web:/app
    environment:
      - TZ=Europe/Madrid

  database:
    image: 'mysql:8.0.34'
    environment:
      MYSQL_ROOT_PASSWORD: H0m3r02010!
      MYSQL_DATABASE: database
    ports:
      - '3306:3306'
    volumes:
      - ./db_app:/var/lib/mysql
    networks:
      - presupuesto-prototiposymfony-network

  phpmyadmin:
    image: phpmyadmin
    ports:
      - 8080:80
    environment:
      - PMA_HOST=database
      - UPLOAD_LIMIT=102400K
    depends_on:
      - database
    networks:
      - presupuesto-prototiposymfony-network
networks:
  presupuesto-prototiposymfony-network:
    driver: bridge

