services:
  nginx-proxy-manager:
    container_name: nginx-proxy-manager
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    environment:
      - DB_MYSQL_HOST=nginx-proxy-manager-db
      - DB_MYSQL_PORT=3306
      - DB_MYSQL_USER=npm
      - DB_MYSQL_PASSWORD=${DB_MYSQL_PASSWORD}
      - DB_MYSQL_NAME=npm
    volumes:
      - /mnt/containers/nginx-proxy-manager/container-data/data:/data:z
      - /mnt/containers/nginx-proxy-manager/container-data/letsencrypt:/etc/letsencrypt:z
    networks:
      - nginx-proxy-manager-nw
      - reverseproxy-nw

  nginx-proxy-manager-db:
    container_name: nginx-proxy-manager-db
    image: 'jc21/mariadb-aria:latest'
    restart: always
    environment:
      - MYSQL_DATABASE=npm
      - MYSQL_USER=npm
      - MYSQL_PASSWORD=${DB_MYSQL_PASSWORD}
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
    volumes:
      - /mnt/containers/nginx-proxy-manager/container-data/mysql:/var/lib/mysql:Z
    networks:
      - nginx-proxy-manager-nw

networks:
  nginx-proxy-manager-nw:
  reverseproxy-nw:
    external: true