services:
  webserver:
    build:
      context: ../
      dockerfile: deploy/Dockerfile_webserver
    env_file: .env
    depends_on:
      - nats
    ports:
      - "8080:8080"
    restart: unless-stopped

  worker:
    build:
      context: ../
      dockerfile: deploy/Dockerfile_worker
    env_file: .env
    depends_on:
      - nats
      - redis
    ipc: host
    user: pwuser
    security_opt:
      - seccomp:seccomp_profile.json
    deploy:
      replicas: 1
    restart: unless-stopped

  nats:
    image: nats:2.10
    command: "-config /nats_config.conf"
    volumes:
      - ./nats_config.conf:/nats_config.conf:ro
      - natsdata:/data
    restart: unless-stopped

  redis:
    image: redis:7.4
    restart: unless-stopped

volumes:
  natsdata:
