services:
  api:
    build:
      context: ./app
    restart: unless-stopped
    networks:
      - backend_net
    volumes:
      - static_volume:/app/staticfiles

  api1:
    build:
      context: ./app
    restart: unless-stopped
    networks:
      - backend_net
    volumes:
      - static_volume:/app/staticfiles

  api2:
    build:
      context: ./app
    restart: unless-stopped
    networks:
      - backend_net
    volumes:
      - static_volume:/app/staticfiles

  api3:
    build:
      context: ./app
    restart: unless-stopped
    networks:
      - backend_net
    volumes:
      - static_volume:/app/staticfiles

  nginx:
    build:
      context: ./nginx
    restart: unless-stopped
    ports:
      - "8080:80"
    volumes:
      - static_volume:/app/staticfiles
    depends_on:
      - api1
      - api2
      - api3
    networks:
      - backend_net

volumes:
  static_volume:

networks:
  backend_net:
    driver: bridge
