services:
  wordpress:
    image: wordpress:latest
    container_name: wordpress
    healthcheck:
     test: curl -f http://localhost:80/ || exit 1
    # ports:
    #  - 8000:80
    depends_on:
      redis:
        condition: service_healthy
    volumes:
      - /home/debian/wordpress:/var/www/html:rw
      - /home/debian/wordpress/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini:rw # custom php.ini
    environment:
      WORDPRESS_DB_HOST: mysql #name container mysql
      WORDPRESS_DB_USER: your_user
      WORDPRESS_DB_PASSWORD: your_password
      WORDPRESS_DB_NAME: name_databas
    networks:
      - npm-internal
    restart: unless-stopped
  redis:
    image: redis:latest
    container_name: redis
    healthcheck:
     test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    volumes:
      - /home/debian/wordpress/redis:/data:rw
    environment:
      TZ: Europe/Rome
    networks:
      - npm-internal
    restart: unless-stopped

networks:
  npm-internal:
    name: npm-internal
    external: true