version: "3.7"
services:
  nginx:
    image: {{ DOCKER_IMAGE_NGINX }}
    restart: unless-stopped
    ports:
      - "{{ NGINX_HTTP_PORT }}:80"
      - "{{ NGINX_HTTPS_PORT }}:443"
    {% if not WEB_PROXY %}
    networks:
      default:
        aliases:
          - "{{ LMS_HOST }}"
          {{ patch("local-docker-compose-nginx-aliases")|indent(10) }}
    {% endif %}
    volumes:
      - ../apps/nginx:/etc/nginx/conf.d/:ro
      - ../../data/openedx-media:/var/www/openedx-media:ro
      {% if ACTIVATE_HTTPS %}- ../../data/letsencrypt:/etc/letsencrypt/:ro{% endif %}
      {{ patch("local-docker-compose-nginx-volumes")|indent(6) }}
    depends_on: {{ [("lms", ACTIVATE_LMS), ("cms", ACTIVATE_CMS)]|list_if }}

  {{ patch("local-docker-compose-prod-services")|indent(2) }}