services:
  whatsapp_api_v1:
    build:
      context: .
      dockerfile: Dockerfile
    restart: unless-stopped
    working_dir: /var/www/
    volumes:
      - ./:/var/www
    networks:
      - backend-nw

  nginx:
    image: nginx:alpine
    restart: unless-stopped
    ports:
        - "8087:80"
    volumes:
        - ./:/var/www
        - ./docker/nginx/:/etc/nginx/conf.d/
        - ./docker/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
        - ./docker/php/conf.d/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini
    networks:
        - backend-nw

  nginx-proxy-manager:
    image: jc21/nginx-proxy-manager:latest
    restart: unless-stopped
    #ports:
      #- "81:81"
      # - "443:443"
    volumes:
      - npm_data:/data
      - npm_letsencrypt:/etc/letsencrypt
    networks:
      - backend-nw

  postgres:
    image: postgres:16
    restart: unless-stopped
    container_name: postgres_bot
    environment:
      POSTGRES_DB: bot_db
      POSTGRES_USER: bot_user
      POSTGRES_PASSWORD: bot_pass
    ports:
      - "5437:5432"
    volumes:
      - postgres_data_bot:/var/lib/postgresql/data
    networks:
      - backend-nw

volumes:
  npm_data:
  npm_letsencrypt:
  postgres_data_bot:
        

networks:
  backend-nw:
    external: true
    
