version: "3.8"

services:
  mongodb:
    image: mongo:latest
    container_name: mongodb
    ports:
      - "27017:27017"
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example
    volumes:
      - mongodb_data:/data/db
    networks:
      - app-network

  python-app:
    build: .
    container_name: serverIPTV-container
    depends_on:
      - mongodb
    environment:
      - MONGO_URI=mongodb://root:example@mongodb:27017/?authSource=admin
    networks:
      - app-network
    volumes:
      - /etc/letsencrypt/:/home/letsencrypt/:rw
      - /home/ubuntu/serverIPTV/:/home/:rw
    ports:
      - "5023:5023"
      - "443:443"

networks:
  app-network:

volumes:
  mongodb_data:
