---
version: "3.8"

services:
  app:
    image: "nginx:stable"
    configs:
      - source: abra_conf
        target: /etc/nginx/conf.d/default.conf
      - source: abra_recipes_json
        target: /var/www/recipes/recipes.json
    volumes:
      - "public:/var/www/recipes"
    networks:
      - proxy
    deploy:
      update_config:
        failure_action: rollback
        order: start-first
      labels:
        - "traefik.enable=true"
        - "traefik.http.services.recipes-json.loadbalancer.server.port=80"
        - "traefik.http.routers.recipes-json.rule=(Host(`recipes.coopcloud.tech`) && PathPrefix(`/recipes.json`))"
        - "traefik.http.routers.recipes-json.priority=99"
        - "traefik.http.routers.recipes-json.entrypoints=web-secure"
        - "traefik.http.routers.recipes-json.tls.certresolver=production"

configs:
  abra_recipes_json:
    file: recipes.json
  abra_conf:
    file: nginx.conf

networks:
  proxy:
    external: true

volumes:
  public: