services:
  api:
    build:
      context: ../../
      dockerfile: services/api/Dockerfile
    container_name: jobs-api
    ports:
      - "8080:8080"
    environment:
      DB_HOST: shared_postgres
      DB_PORT: 5432
      DB_NAME: jobs_scraper
      DB_USER: scraper_user
      DB_PASSWORD: Cocowawa_12345

      # RabbitMQ Configuration
      RABBITMQ_HOST: 172.18.0.9
      RABBITMQ_PORT: 5672
      RABBITMQ_USER: admin
      RABBITMQ_PASSWORD: 123Kari123!
    networks:
      - proxy
    restart: unless-stopped
    labels:
      - traefik.enable=true
      - traefik.docker.network=proxy
      - traefik.http.routers.api-jobs.rule=Host(`api-jobs.ai-assistant-bot.xyz`)
      - traefik.http.routers.api-jobs.entrypoints=web,websecure
      - traefik.http.routers.api-jobs.tls.certresolver=le
      - traefik.http.services.api-jobs.loadbalancer.server.port=8080
    # deploy:
    #   resources:
    #     limits:
    #       memory: 512M
    #       cpus: "1"
    #     reservations:
    #       memory: 128M
    #       cpus: "0.25"
networks:
  proxy:
    external: true
